Skip to content

Cursor moves to wrong position when pressing down arrow at end of table that is last node #6034

@BiosSun

Description

@BiosSun

Description

If a table is the last node in the editor and the cursor is placed at the end of the table, pressing the down arrow key moves the cursor below the </table> element. When a character is then entered, it is inserted both at the last position inside the table and at the cursor’s current location.

Similarly, if the table is the first node in the editor and the cursor is at the very beginning of the table, pressing the up arrow key moves the cursor above the <table> element.

Recording

CleanShot.2026-03-30.at.00.12.58.mp4

Sandbox

The issue can be reproduced using the official table example.

Steps

  1. Open the official table example: https://www.slatejs.org/examples/tables;
  2. Delete the text paragraph below the table in the example;
  3. Move the cursor to the last position inside the table;
  4. Press the down arrow key;
  5. Enter a character;

Expectation

The cursor should not move to an incorrect position.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions