facebook / lexical

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

Bug: Select all in copy pasted table broken #5987

Open potatowagon opened 2 weeks ago

potatowagon commented 2 weeks ago

Lexical version:

Steps To Reproduce

  1. copy this html table
First Header Second Header
Content Cell Content Cell
Content Cell Content Cell
  1. paste into lexical
  2. add some text above the table
  3. select all (use keyboard shortcut)
  4. notice the selection in debug tree view is only midway, not all selected
  5. press backspace, only some cells get deleted. expected -> whole table get deleted
  6. repeat this enough and the editor freezes

The current behavior

https://github.com/facebook/lexical/assets/19604232/3c46aa9b-8e1b-4fe8-aaf3-c87d273da3cb

https://github.com/facebook/lexical/assets/19604232/e6274cce-f00e-498b-8eee-91a672f0437a

^ clue: notice how i can repro the incomplete selection if i dont drag my mouse all the way to the right to select all. if i drag all the way, i can select the remaining nodes in tree view

The expected behavior

all selected, all deleted. Not reproducible with table that is created in lexical, only happens for pasted table.