Bug 257745 - Pressing Backspace or Delete within a contenteditable="true" summary removes all content
Summary: Pressing Backspace or Delete within a contenteditable="true" summary removes ...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: Safari 15
Hardware: All All
: P2 Normal
Assignee: Nobody
URL: https://glitch.com/edit/#!/prosemirro...
Keywords: InRadar
Depends on:
Blocks: 252223
  Show dependency treegraph
 
Reported: 2023-06-06 06:38 PDT by hi
Modified: 2023-12-20 05:00 PST (History)
7 users (show)

See Also:


Attachments
Video demonstration of pressing Backspace in the <summary> tag in Safari. (1.25 MB, image/gif)
2023-06-06 06:38 PDT, hi
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description hi 2023-06-06 06:38:51 PDT
Created attachment 466602 [details]
Video demonstration of pressing Backspace in the <summary> tag in Safari.

Pressing Backspace or Delete within <summary> tag removes all the content in Safari. Chrome and Firefox removes a single character as expected.

Example: https://glitch.com/edit/#!/prosemirror-safari-backspace-bug
Comment 1 Andrew Herron 2023-06-06 16:46:01 PDT
The problem tag name makes it quite difficult to search for a duplicate.

Confirmed by various members of our team on:
Version 16.3 (18614.4.6.1.6)
Version 16.5 (18615.2.9.11.4)
Version 16.6 (18615.3.5.11.2)
STP Release 171 (Safari 16.4, WebKit 18616.1.15)

I'll test the new version 17 when I get a chance to install the dev beta on my machine (but I assume that's basically the same as STP).
Comment 2 Andrew Herron 2023-06-06 16:47:54 PDT
This is holding up a TinyMCE release, we're just going to have to list it as a known issue
Comment 3 Andrew Herron 2023-06-06 17:22:32 PDT
Better replication case, using pure ContentEditable instead of prosemirror:
https://codepen.io/tinymce/pen/wvQveOX?editors=1000
Comment 4 Ryosuke Niwa 2023-06-06 17:31:00 PDT
Is this a regression? Or the problem reproduces in older versions of Safari as well as newer versions?
Comment 5 Andrew Herron 2023-06-06 17:33:54 PDT
I'm not sure if we have any easily available older OS versions, I'll start grabbing some archives and see if I can track it down.
Comment 6 Andrew Herron 2023-06-06 18:05:01 PDT
bisect-builds is telling me `No archives found` for both mac-ventura configurations 🤔

We found an old mac running 10.15.7, Safari Version 15.5 (15613.2.7.1.9, 15613) and it does replicate there. So probably not a regression - we just hadn't tested our new feature well enough.
Comment 7 Andrew Herron 2023-06-07 16:40:51 PDT
Our engineers found an interesting workaround, wrapping the contents of the <summary> tag in a span before deleting with execCommmand:
https://codepen.io/spocke78/pen/vYQYWoJ?editors=1010

So we're implementing that for our release:
https://github.com/tinymce/tinymce/pull/8803
Comment 8 Radar WebKit Bug Importer 2023-06-13 06:39:15 PDT
<rdar://problem/110707639>