Skip to content

Bug: Odd selection behavior with table as last element in document #7999

Description

@alur

Lexical version: 0.38.2

Steps To Reproduce

  1. Insert a table and delete anything after it.
  2. Click to the right of the table.
  3. Press right arrow key repeatedly.

The current behavior

When you click to the right of the table the cursor briefly shows next to the table before moving into the last table cell.

The cursor goes in a loop consisting of

  1. The last cell of the table.
  2. A block cursor beneath the table.
  3. The right hand side of the table.

Additionally, pressing enter when the cursor is on the right hand side of the table inserts a newline above the table rather than beneath it.

The expected behavior

I'd expect the cursor to go beneath the table when pressing the right arrow from the last cell. And then to stay there rather than cycle back up.

Impact of fix

Mostly polish, but it can be hard to figure out how to add content after the table. Had a user tell me it couldn't be done.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions