hi
I...">

2 contentEditable containers inside each other; maybe a mistake?

<div contenteditable="true">
<div contenteditable="true">hi</div>
</div>

If you try to edit the inner contentEditable div, which is practically located when you click on it, you will get stuck on it and will not be able to insert anything outside it unless you delete the child content accessible by inverse space. Clicking outside the inner div does not help, even if the outer div is larger. This happens on FF and Webkit.

Is this a mistake or does it work like that? Any decision to change this behavior? for example, when you go beyond the inner div, you start editing the outer.

Greetings
Pars

+4
source share
1 answer

I got the same here

 <div contenteditable="true"> father <div contenteditable="false"> child </div> </div> 

If I select a child div , I can remove the text from the child , but not edit it . Text father . I can delete and edit.

I think the logic is correct and makes sense. If you change the child div to true, you can remove and edit the tag.

The problem is this: you cannot see the father and child of the div when the content has been deleted. then you only assume that the first is the father of the div, and the second is the child.

Nice post!

+2
source

All Articles