[Webkit-unassigned] [Bug 276926] New: In a shadow root hosting element that has contenteditable=plaintext-only, the last inserted text node gets deleted as a whole instead of character-by-character

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jul 22 21:11:00 PDT 2024


https://bugs.webkit.org/show_bug.cgi?id=276926

            Bug ID: 276926
           Summary: In a shadow root hosting element that has
                    contenteditable=plaintext-only, the last inserted text
                    node gets deleted as a whole instead of
                    character-by-character
           Product: WebKit
           Version: Safari 17
          Hardware: Mac (Apple Silicon)
                OS: macOS 14
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: HTML Editing
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: zacky at marchbox.com
                CC: wenson_hsieh at apple.com

Given an element like so:

```
<div contentediable=plaintext-only><template shadowrootmode="open"><slot></slot></template></div>
```

If a user type the following text character by character (as opposed to pasting the whole text with line breaks):

abc<Enter>
de<Enter>
fgh

Hit Backspace, "fgh" is deleted, caret moves right after "e", after this, hitting Backspace deletes character-by-character which is expected.

Seems if the container is a `<pre>` element, this issue doesn't occur.

Example: https://codepen.io/marchbox/pen/oNrLWjY

There is a previous unclosed bug here: https://bugs.webkit.org/show_bug.cgi?id=266700. But from my testing, seems `contenteditable=true` works fine, but `contenteditable=plaintext-only` doesn't.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20240723/36c37831/attachment.htm>


More information about the webkit-unassigned mailing list