Skip to content

Bug: The cursor doesn't move to the end of the line if the first node is a decorator #8555

Description

@levensta

Lexical version: 0.44

Steps To Reproduce

  1. Create an inline decorator node (for example DatetimeNode), then write any text on the same line
  2. Move the cursor to the beginning of the paragraph
  3. Press the key combination Ctrl + ArrowRight. With or without Shift

Link to code example: https://playground.lexical.dev/#doc=H4sIAAAAAAAAE-1UTWsCMRD9K2XOUbOLXbv5AZ4LemrpIZhZDY3JMjsrFfG_l1kVq4UKW6GXnpL3SN6befnYATrPiWZsGcHsgFJiGRcrHxxhBPN6BRyy9QGMVlAlWlvupuvkEAxEYQIoaHgbhAAFjB8MBqYpCdjWQnecgg1S41MEk-3VnWwefjJ5U-A84YI7HNsQzuqi4aPDeHA6agQf3y80FBCGQwlYIRGSGFpaIp8U2bMUdQAtyeoVc92Y0Qikz6O0s4zs13glL_RcaAO5zouBfhzkep5nRmuj9VBr_QI9Gqkt2SXZenVlJyFNzwELnJ1C_XYod6hc_eJob1yhPwqlbzvVjefwHzb0uejdD3ZR6l5BsA3P7AYdmGwyKYviqSyLrJwoaFJLC9n3HOx2SamN7utu0MPxeKhh_wl7MiVxKgUAAA

The current behavior

The cursor remains at the beginning of the line

Screen.Recording.2026-05-25.at.03.30.17.mov

The expected behavior

The cursor moves to the end of the line. If you hold down Shift, the line is selected from beginning to end

Impact of fix

This behavior only reproduces if the DecoratorNode is the first element in the line. If there is text before it and the caret is positioned before the decorator, cursor movement will work correctly. The cursor also moves correctly from the end to the beginning if the decorator is the last element

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions