facebook / lexical

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

Bug: Table is not deleted correctly when selected by shift + arrowup #5897

Open 2wheeh opened 2 weeks ago

2wheeh commented 2 weeks ago

Lexical version: 0.14.3 (the latest)

Steps To Reproduce

This one is separated from https://github.com/facebook/lexical/issues/5544#issuecomment-1953488420 and related with #5543

  1. insert a table.
  2. make it sure there is not next sibling paragraph node.
  3. select the table by shift + arrowup.
  4. delete by backspace key.
  5. the issue happens in across browsers but same in safari and chrome and different in firefox probably due to different selection behavior.

Link to code example: can reproduce in playground

The current behavior

in Safari and Chrome

https://github.com/facebook/lexical/assets/40269597/42f5b411-9cfa-44fd-816c-332bbbc9e59d

https://github.com/facebook/lexical/assets/40269597/af352254-9409-4042-9f65-07833d00048b

https://github.com/facebook/lexical/assets/40269597/6de543d7-e562-4258-a5ae-37653babc545

in Firefox

https://github.com/facebook/lexical/assets/40269597/3db49ece-3ce2-47e4-902a-61c1d96d6869

https://github.com/facebook/lexical/assets/40269597/4597636b-8a1b-49ae-8e4e-132f91cb0995

https://github.com/facebook/lexical/assets/40269597/a825b73d-25c4-402c-a9ec-e9751beedba4

The expected behavior

delete the table with its children whether there is any sibling or not.

2wheeh commented 2 weeks ago

@Sahejkm Would you confirm this is able to be replicated ?

Sahejkm commented 2 weeks ago

@Sahejkm Would you confirm this is able to be replicated ?

yea am able to replicate this. Thanks for detailed repro.