0
votes

I have a div with a contenteditable="true" property in a component.

subcomponent html:

<div class="text" contenteditable="true" >
</div>

. Main component html:

<html>
    <body>
        <app-subcomponent
            [someValue]="someValue">
        </app-subcomponent>
    </body>
</html>

It does result in the standard blue outline as expected but it is not editable. However if I would add the div with the contenteditable property inside the main component it works fine.

Why is this the case and how can I solve it? I can use the input and textarea elements (and they work) but I would prefer the div editable method because it would be a more elegant solution in this case.

1
It seems to work, so maybe you should provide a minimal reproducible exampleuser4676340
I know that I have done it before without issues so maybe it's indeed because my specific case, I will go ahead and isolate the section of the code while maintain the problem.Rick Vink
Please give us a sandbox to verify that you indeed have this issue.user4676340
I one by one commented all my code and found that the command: jQuery(".freeSelect").disableSelection(); Resulted in this behavior. Thanks for your timeRick Vink
No problem, glad I could help !user4676340

1 Answers

0
votes

The issues was outside of this part of the code: I had the jQuery(".freeSelect").disableSelection(); somewhere and it only acted on the subcommponent and not my main component