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] Safari: Wrong cursor placement #624

Closed
2 tasks done
mnlkrs opened this issue Nov 5, 2024 · 3 comments
Closed
2 tasks done

[BUG] Safari: Wrong cursor placement #624

mnlkrs opened this issue Nov 5, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@mnlkrs
Copy link

mnlkrs commented Nov 5, 2024

  • I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
  • I have read the documentation and cannot find an answer.

Describe the bug
On Safari, when the current editor content ends with an element with contenteditable="false" the caret will display at the very start of the editor. This also results in a user not being able to click next to the element to place.
2024-11-05 23 57 47

To Reproduce
On Safari:

  1. Open the demo
  2. Type something
  3. Insert an image

Expected behavior
Like in other browsers, the caret should simply be put next to the element after inserting or when clicking:
2024-11-06 00 01 59

Desktop:

  • OS: MacOS
  • Browser: Safari

Additional context
This is definitely a bug with Safari itself & not this library per se, however it still breaks the experience for Safari users.
Other libraries have faced the same problem:

They have all seemed to fix it using an empty image tag:

@mnlkrs mnlkrs added the bug Something isn't working label Nov 5, 2024
@petyosi
Copy link
Contributor

petyosi commented Nov 6, 2024

MDXEditor uses Lexical. When facebook/lexical#6282 gets merged, the fix will propagate. Feel free to track the problem with Lexical (perhaps there's some additional work to be done on the PR there?) and open a lexical version update for this repository.

@petyosi petyosi closed this as not planned Won't fix, can't repro, duplicate, stale Nov 6, 2024
@mnlkrs
Copy link
Author

mnlkrs commented Nov 6, 2024

Great, could've taken a deeper look into this repo! Thanks for the swift response 👍

@mnlkrs
Copy link
Author

mnlkrs commented Nov 13, 2024

The issue has been worked on in another PR, which has been merged. facebook/lexical#6759
I'll have a close look at the releases!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants