ueberdosis / tiptap

The headless rich text editor framework for web artisans.
https://tiptap.dev
MIT License
27.55k stars 2.29k forks source link

[Bug]: backspace with empty list item in safari with software keyboard causing invalid behavior #5753

Open cchyung opened 3 weeks ago

cchyung commented 3 weeks ago

Affected Packages

core, extension-list-item, extension-list-keymap

Version(s)

2.9.0

Bug Description

This issue occurs when using safari iOS with the standard software keyboard. When you have the cursor at the front of the paragraph of a list item and try to press backspace, it instead removes the list item and moves the paragraph into the list item above as a sibling.

This is a video testing on TipTap's own website for list-keymap which should combine the two bullets into one on the first backspace click:

https://github.com/user-attachments/assets/89c2b663-1f5d-433c-92a4-befb9396f660

After further investigation, it appears that something is intercepting the backspace command and setting preventDefault to true before the event even gets to TipTap.

This is happening on iOS 17.5 and iOS 18 via the simulator.

Weirdly enough, the intended behavior occurs when I open the site on iOS 18.1 on safari with software keyboard.

Browser Used

Safari

Code Example URL

No response

Expected Behavior

Backspace event is getting preventDefault: true when hitting backspace at the front of a list item. Causing weird irregular behavior with list-keymap.

Additional Context (Optional)

No response

Dependency Updates