Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: BlockCursorElement inconsistent/unresponsive behavior #6822

Open
madsone opened this issue Nov 13, 2024 · 3 comments
Open

Bug: BlockCursorElement inconsistent/unresponsive behavior #6822

madsone opened this issue Nov 13, 2024 · 3 comments
Labels
tables Relates to Lexical Tables

Comments

@madsone
Copy link

madsone commented Nov 13, 2024

Lexical version: 0.20.0

Steps To Reproduce

  1. Insert a table
  2. Put the table as the first element in the editor
  3. Use arrow-up so that the cursor is laying flat over the table
  4. Press down on the keyboard
  5. Do the same thing, but at the bottom of a table

Screenshot 2024-11-13 at 11 49 07
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.

@madsone madsone closed this as completed Nov 13, 2024
@madsone madsone reopened this Nov 13, 2024
@etrepum
Copy link
Collaborator

etrepum commented Nov 13, 2024

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.

@madsone
Copy link
Author

madsone commented Nov 14, 2024

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.

@etrepum etrepum added the tables Relates to Lexical Tables label Nov 14, 2024
@etrepum
Copy link
Collaborator

etrepum commented Nov 14, 2024

I think this is a missing piece of the selection normalization that needs to happen with tables, it's certainly a bug either way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tables Relates to Lexical Tables
Projects
None yet
Development

No branches or pull requests

2 participants