ProseMirror / prosemirror

The ProseMirror WYSIWYM editor
http://prosemirror.net/
MIT License
7.61k stars 336 forks source link

Using IME will delete an empty relative block after input #1357

Closed ocavue closed 1 year ago

ocavue commented 1 year ago

When using IME and input something in a empty block with CSS position: relative rule, the block will be deleted after input.

Steps to reproduce:

  1. Open https://prosemirror.net/ with Safari
  2. Create an empty blockquote
  3. Add the following CSS rule: blockquote: { position: relative; }
  4. Enable IME (I use Chinese Pinyin)
  5. Input a character
  6. The blockquote is gone

Video demo:

https://user-images.githubusercontent.com/24715727/221364912-6cec0952-f9ba-4603-b94c-4a92e4c3090a.mp4

I guess this bug has something to do with the following Safari bug (dom.nodeName in this case is also "BR"), but I haven't find a workaround after some quick tries.

https://github.com/prosemirror/prosemirror-view/blob/49903c758/src/domchange.ts#L62-L69

ocavue commented 1 year ago

I found this issue is a duplication as https://github.com/ProseMirror/prosemirror/issues/934. I'm going to close it.