Skip to content

Bug: tab insertion breaks format inheritance #8151

Closed

Description

@kimseongyu

Lexical version: 0.40.0

Steps To Reproduce

  1. Type bolded "hello" in the editor
  2. Move the cursor between "he" and "llo"
  3. Press the Tab key twice
  4. Move the cursor between the two tabs
  5. Start Typing any character

Link to code example: playground

The current behavior

issue.mov

The format disappears between the tabs.

The expected behavior

If a user inserts tabs within a formatted range, those tabs should maintain the formatting.

Impact of fix

Activity

  1. etrepum commented on Feb 19, 2026

    @etrepum
    Collaborator

    Should be a fairly straightforward fix, a TabNode is a TextNode after all and it does take format when applied to an existing TabNode so this is probably just the code not considering the selection's format after calling $createTabNode()

  2. kimseongyu commented on Feb 19, 2026

    @kimseongyu
    ContributorAuthor

    Thanks for the quick feedback! I found that the same issue occurs with Linebreak. Unlike TabNode, LineBreakNode inherits from LexicalNode, not TextNode.

  3. etrepum commented on Feb 19, 2026

    @etrepum
    Collaborator

    Yes, that would be a distinct issue with a different approach because it is not a TextNode. Normally the selection should carry the format when navigating around LineBreakNode. If you have scenarios where you think it should work differently then it does they should be reported in a separate issue from this TabNode one.

  4. kimseongyu commented on Feb 19, 2026

    @kimseongyu
    ContributorAuthor

    It looks like the same kind of issue, but it needs a different approach in detail. I'll open a separate issue after resolving this one!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions