facebook / lexical

Lexical is an extensible text editor framework that provides excellent reliability, accessibility and performance.
https://lexical.dev
MIT License
19.19k stars 1.62k forks source link

Bug: Option + Right arrow cursor bug (Firefox) #4338

Open bvaughn opened 1 year ago

bvaughn commented 1 year ago

Lexical version: Latest

Steps To Reproduce

  1. Open Lexical playground
  2. Replace text with "foo.bar"
  3. Set cursor to beginning of text
  4. Type OPTION + right arrow

Here is a Replay of the bug: https://app.replay.io/recording/2d509a52-e59b-40bd-83a9-ba17e89c90b8

The current behavior

In Firefox, the cursor is now after the dot

The expected behavior

Cursor should move before dot

zurfyx commented 1 year ago

Thanks Brian, love the detailed Replay recording!

While this is a certainly different from Chrome, I wonder how much we want to do (as Lexical) in this case. We have normalized editor behavior in the past to fix broken functionality around keypresses but in this case, the minimal behavior difference doesn't seem to impact functionality and works just like the built-in contenteditable.

Interestingly, different editors seem to have different behavior. GDoc has slightly different behavior from Quip (even though this specific case is normalized) and Notion didn't.

I'll check with the team to determime what our stance should be on this.

bvaughn commented 1 year ago

That makes sense 👍🏼