Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Cursor is going away after a hard Break while loading editor within the shadow DOM environment in WebKit (Safari). #5026

Open
1 of 2 tasks
aagash-ni opened this issue Apr 3, 2024 · 6 comments
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Info: Needs more info The issue or pullrequest needs more information before it can be worked on Info: Needs Reproduction The issue or pullrequest needs a reproduction before it can be worked on Type: Bug The issue or pullrequest is related to a bug

Comments

@aagash-ni
Copy link

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:
Error Image

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.
Code Image

Without a shadow dom environment, it is working as expected.

Did you update your dependencies?

  • Yes, I’ve updated my dependencies to use the latest version of all packages.

Are you sponsoring us?

  • Yes, I’m a sponsor. 💖
@bdbch
Copy link
Member

bdbch commented Apr 6, 2024

Could you provide a Codesandbox / Stackblitz with a Shadow DOM please so we can reproduce the error.

@bdbch bdbch added Info: Needs more info The issue or pullrequest needs more information before it can be worked on Info: Needs Reproduction The issue or pullrequest needs a reproduction before it can be worked on labels Apr 6, 2024
@aagash-ni
Copy link
Author

aagash-ni commented Apr 9, 2024

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

tiptap

I have reported this similar issue in Prosemirror and they suggested upgrading the prosemirror-view package to version 1.33.4.
ProseMirror/prosemirror#1454 (comment)

@aagash-ni
Copy link
Author

Could you please provide an update regarding this, @bdbch?

@aagash-ni
Copy link
Author

aagash-ni commented Apr 23, 2024

@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.

@m-akinc
Copy link

m-akinc commented Jun 5, 2024

@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?

@nperez0111
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Info: Needs more info The issue or pullrequest needs more information before it can be worked on Info: Needs Reproduction The issue or pullrequest needs a reproduction before it can be worked on Type: Bug The issue or pullrequest is related to a bug
Projects
No open projects
Status: Triage open
Development

No branches or pull requests

4 participants