-
-
Notifications
You must be signed in to change notification settings - Fork 332
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
Incorrect (visual) cursor in Safari if atom node is last node in line #1165
Comments
As mentioned in the referenced issue, this is not just an issue on iOS. It also happens in Safari 14.1 on desktop. |
Ah you are right! So maybe this will be easier to debug. |
I noticed that the issue goes away if you set the Of course, setting |
…ne on Safari To avoid a bug where the browser draws the cursor at the start of the line. FIX: Work around a Safari bug where it draws the cursor at the start of the line when it is after an uneditable node at the end of the line. Issue ProseMirror/prosemirror#1165
This is definitely a browser bug, but attached patch tries to work around it by injecting an additional src-less |
Thanks @marijnh. Looks like there's a separate bug in this. It does fix the bug described in this issue, but if the cursor moves to an empty paragraph (including if the entire document is empty), there is a crash: In if (result.safari && lastChild.dom.contentEditable == "false") Here's a way to repro with the Dino example:
|
Argh, my bad, yes, that was an obvious bug. Attached patch should address it. |
Looks good. In my app I tested things such as cursor movement, selection, clicking, typing, and pasting near this, and everything was fine. |
Thanks for the fix. Looks good to me! |
I'm seeing this after another type of atom node, also in Safari. The node has |
Issue details
When using atom nodes it’s not possible to place the cursor after it when the node is the last node in a line. You can see that in the offical dinos example. When placing a dino at the end of a line, Safari renders the cursor at the start of a line. If I type something, the content will be placed after the dino (which is correct) but it feels weird because of the wrong (visual) cursor rendered by Safari.
Steps to reproduce
ProseMirror version
prosemirror-view: 1.18.4
Affected platforms
Screenshots / Screencast (Optional)
RPReplay_Final1620282287.MP4
The text was updated successfully, but these errors were encountered: