facebook / lexical

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

Bug: "Tap" clicking with node selection clears selection. #4469

Open mitchknife opened 1 year ago

mitchknife commented 1 year ago

When I have a node selection and "tap" click (using Mac trackpad) into some text outside the selected nodes, the current selection is set to null and no SELECTION_CHANGE_COMMAND is dispatched. Full clicks work as expected.

Lexical version: 0.10.0

Steps To Reproduce

  1. Open the Lexical Playground
  2. Insert a GIF
  3. Type some text in a new paragraph
  4. Select the GIF (the node selection)
  5. Tap click into the text.

The current behavior

The selection is cleared (set to null) and no selection change command is dispatched.

The expected behavior

The behavior should be the same as a regular "click": the text below should have the selection and a selection change command should be dispatched.

mitchknife commented 1 year ago

Just checked Firefox which seems to NOT have the same behavior, so this might be Chrome specific.