Extra BR inserted in pre-wrap contenteditable DIV after select all & delete.
Categories
(Core :: DOM: Editor, defect)
Tracking
()
People
(Reporter: albright, Unassigned)
References
Details
Attachments
(1 file)
|
220 bytes,
text/html
|
Details |
Updated•12 years ago
|
Comment 1•12 years ago
|
||
Updated•12 years ago
|
Comment 4•10 years ago
|
||
Comment 5•9 years ago
|
||
Comment 6•5 years ago
|
||
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0
Confirmed
Both with Backspace and Delete
Updated•5 years ago
|
Updated•5 years ago
|
Comment 7•5 years ago
|
||
I think this and bug 1513303 are the same.
Comment 8•5 years ago
|
||
Confirmed on Firefox 75 white-space:pre-wrap is not required, should I change summary?
When you have a final whitespace at the end of the contenteditable, when you remove the <br> programatically, then if you type any character after the whitespace, then the whitespace get removed and is replaced with the new character
Updated•3 years ago
|
Comment 10•1 year ago
|
||
The implication of all the above comments is that it is just the contenteditable that has this problem, but in actual fact it is at any level below the contentedititable div. I can also confirm the the comment from @sg above that after removing the <br> tag programatically that typing a character after the white space causes the white space to be removed.
I want to add that I put a mutation observer on contenteditable and when I add the trailing space there are two mutation records, one of type characterData which contains the current Text node as the target with the space present and a second of type childList where the added node is the <br>
When I then remove the <br> in the mutation observer call back I get a second mutation change with just a childList mutation with the <br> as a removed node, but nothing else. Only when I type a new character after the space do I then see a further mutation with a CharacterData record showing the text with the space removed and this new character added.
Here is the html inside the contenteditable with a vertical bar showing cursor selection point
<ol><li>Here is so<ul><li>This|</li></ul>me <span>text in a span some of which is <u>Underlined</u> and <i>Italic</i> but then</span> after the span <b>bold text</b></li><li>This is simpler</li></ol>
Then immediately after the space has been added and the mutation observer was able to remove the <br>
<ol><li>Here is so<ul><li>This |</li></ul>me <span>text in a span some of which is <u>Underlined</u> and <i>Italic</i> but then</span> after the span <b>bold text</b></li><li>This is simpler</li></ol>
And finally after I type another "i"
<ol><li>Here is so<ul><li>Thisi|</li></ul>me <span>text in a span some of which is <u>Underlined</u> and <i>Italic</i> but then</span> after the span <b>bold text</b></li><li>This is simpler</li></ol>
Description
•