Skip to content

fix Firefox arrow navigation bug #683

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

jmusial
Copy link
Collaborator

@jmusial jmusial commented May 23, 2025

Fixes navigation bug on Firefox, where navigation using arrows over emojis requires 2 key presses.

Screen.Recording.2025-05-21.at.09.55.11.mov

Details

In Firefox, the arrow key navigation treats surrogate pairs (like emojis) as two separate code units, while Chromium browsers treat them as a single character. This discrepancy causes the “double-arrow press” behaviour.

Related Issues

GH_LINK

Manual Tests

  1. Open editor with some emojis typed in
  2. Try navigating with your arrows
  3. Results should be consistent across all browsers and 1 key press should move cursor over 1 emoji

Videos

Before

LM_emojis_before.mov

After

LM_emojis_after.mov

Linked PRs

Copy link

github-actions bot commented May 23, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@jmusial
Copy link
Collaborator Author

jmusial commented May 23, 2025

recheck

@tomekzaw tomekzaw changed the title fix Firefix arrow navigation bug fix Firefox arrow navigation bug May 25, 2025
@jmusial jmusial marked this pull request as ready for review May 27, 2025 14:46
Copy link
Collaborator Author

@jmusial jmusial left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While testing noticed that the issue is also present for left arrow when navigating backwards and /or with multiple emojis. Added code and test cases to cover that.

@jmusial jmusial requested a review from Skalakid June 18, 2025 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants