udecode / plate

A rich-text editor powered by AI
https://platejs.org
Other
11.99k stars 732 forks source link

IME text cannot be deleted with backspace after pressing enter in iOS Safari #3752

Open ezingme opened 1 week ago

ezingme commented 1 week ago

Description

In iOS Safari, after entering IME text and pressing enter, the text cannot be deleted using the backspace key.

Reproduction URL

https://platejs.org/

Reproduction steps

  1. Go to https://platejs.org/ in iOS Safari
  2. Double-tap the word "Playground" in the editor to select it
  3. Enable an IME keyboard, type any text, and accept it using the enter key
  4. Try using the backspace key to delete the entered text
  5. The page crashes with two errors in the console; see below

Cannot reproduce on https://slatejs.org/.

Sometimes, instead of crashing, the editor silently fails to delete the inserted text.

Plate version

39.3.7

Slate React version

0.110.1

Screenshots

No response

Logs

Error: Cannot resolve a Slate point from DOM point: [object HTMLDivElement],0
        toSlatePoint (b7bbbec9-c6a800ffbca1bf25.js:1:13367)
    toSlateRange (b7bbbec9-c6a800ffbca1bf25.js:1:14670)
        [...]
NotFoundError: The object can not be found here.
        removeChild
        [....]

Browsers

iOS Safari

abhi-bc commented 1 week ago

Wonder if it is related to this? https://github.com/udecode/plate/discussions/3584