Open madsone opened 1 day ago
Are you trying this with the current playground, or v0.20? The current playground is always deployed from the latest main commit and has changes that affect both tables and the reconciler. The browser you're testing with is also relevant here, they all behave a bit differently in contentEditable especially with how keyboard navigation works. There is no standard.
Sorry for the confusion. I was first going to show my local setup, but it seemed easier to use the playground since it produced the same behaviour.
Im using Google Chrome(130.0.6723.117) on the Lexical Playground.
I think this is a missing piece of the selection normalization that needs to happen with tables, it's certainly a bug either way.
Lexical version: 0.20.0
Steps To Reproduce
The screenshot show the inital state in order to reproduce the behavior
Link to code example: https://playground.lexical.dev/
The current behavior
When using a flat cursor and pressing the arrow down key from the top, the cursor correctly navigates to the first element in the table. However, the cursor is not visible and typing does not produce visible text. Additionally, it would be expected for the arrow down key to navigate within the table.
Sometimes it is possible to write in the first cell, but the cursor is not updated until one starts writing.
On the other hand, when starting from the bottom, the behavior works better. Pressing the left-arrow key will navigate to the bottom-right cell. However, it would make sense for the arrow up key to navigate back to the table.
The expected behavior
Mentioned above. Pressing the key up/down should make the cursor enter the table and show correctly where you are in the editor.
Impact of fix
This issue is a minor bug that primarily affects accessibility. While it is not causing an outage, it would be considered a "nice-to-have" improvement rather than a critical one.
The users who would most benefit from this fix are those who rely on keyboard navigation to use the editor. Currently, it is possible to work with, but implementing this upgrade would greatly improve the experience for keyboard users.