tiptap
tiptap copied to clipboard
[Bug]: Cursor is going away after a hard Break while loading editor within the shadow DOM environment in WebKit (Safari).
Which packages did you experience the bug in?
@tiptap/extension-hard-break
What Tiptap version are you using?
2.2.4
What’s the bug you are facing?
While loading the editor with hard break extension within the shadow DOM
environment in WebKit (Safari), pressing Shift + Enter (HardBreak) causes the cursor to vanish.
What browser are you using?
Safari
Code example
No response
What did you expect to happen?
The cursor should appear in the new line after the hard break.
Anything to add? (optional)
While using the editor in a WebKit environment and pressing Shift + Enter (Hard Break), an error was thrown in the console, as shown below:
Upon further investigation, it appears that the issue occurs in the safariShadowSelectionRange
method within the Prosemirror-view
package. This problem arises because the beforeInput
event is not triggered, resulting in the found
variable being left undefined.
Without a shadow dom environment, it is working as expected.
Did you update your dependencies?
- [X] Yes, I’ve updated my dependencies to use the latest version of all packages.
Are you sponsoring us?
- [ ] Yes, I’m a sponsor. 💖
Could you provide a Codesandbox / Stackblitz with a Shadow DOM please so we can reproduce the error.
Hello @bdbch, thanks for responding. Here is the Stackblitz link Tiptap Editor loaded ShadowDom https://stackblitz.com/edit/typescript-m6mkib?file=index.ts
Try doing hardBreak
(Shift + Enter) in Webkit Env (Safari), the cursor will disappear
I have reported this similar issue in Prosemirror and they suggested upgrading the prosemirror-view
package to version 1.33.4
.
https://github.com/ProseMirror/prosemirror/issues/1454#issuecomment-2042135375
Could you please provide an update regarding this, @bdbch?
@bdbch, I have attempted to replicate the hardbreak workflow
using tiptap version 2.3.0
. The issue of the cursor disappearing still persists, but there are no errors in the console (Prosemirror-view package).
You can try it here: https://stackblitz.com/edit/typescript-m6mkib?file=index.ts.
@bdbch Looks like aagash added the reproduction case you asked for. Could you or someone else please remove the "Needs Reproduction"/"Needs more info" tags so that this can be considered?
Unfortunately, we do not have control of the prosemirror-view package so I think we would need to make something upstream for this https://github.com/ProseMirror/prosemirror-view