ueberdosis / tiptap

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

[Bug]: Safari/Chrome selection issue inside shadow dom #4919

Open tamirgold95 opened 8 months ago

tamirgold95 commented 8 months ago

Which packages did you experience the bug in?

@tiptap/pm

What Tiptap version are you using?

2.2.4

What’s the bug you are facing?

I have an issue while using tiptap on Safari/Chrome inside Shadow Dom using IOS while typing in Japanese (and other similar languages like Chinese, Korean, and Thai).

When typing using Japanese characters, the entire comment is constantly selected which can cause some problems.

Steps to reproduce:

  1. On Safari IOS try to type in Japanese.
  2. If you select a predictive text and then continue typing, it will remove all your text. OR
  3. When clicking the “Return” button instead of just adding a new line it will replace the current text.

Expected result: the text shouldn't be selected.

Actual result: comment text is selected on IOS.

Platform : Safari IOS

What browser are you using?

Safari

Code example

https://codesandbox.io/p/sandbox/aged-platform-ssf6ks?file=%2Fsrc%2FApp.js

What did you expect to happen?

Expected result: the text shouldn't be selected.

Anything to add? (optional)

No response

Did you update your dependencies?

Are you sponsoring us?

gwidonw commented 7 months ago

+1 on this. Thanks for reporting @tamirgold95

peka2 commented 6 months ago

I'm facing the same issue with tiptap-vue2 and Web Components where Japanese input on iPhone gets automatically selected. Has anyone found a workaround?

related to https://github.com/ProseMirror/prosemirror/issues/1455