Skip to content

Bug: Text direction bug when paragraph starts with a marknode #7021

Open
@ebads67

Description

The text direction (ltr vs rtl) of a paragraph is usually determined by the first letter of the paragraph. However if the first part of the paragraph including the first letter is wrapped in a marknode for commenting, the text direction is set without considering the text inside the marknode.

Lexical version:

Steps To Reproduce

  1. Add an English word in an empty Lexical playground.
  2. Add some letters from rtl language. The direction doesn't change.
  3. Now wrap the English word in marknode by selecting it and adding a comment on it. The text direction is changed from ltr to rtl.

The expected behavior

The text direction should not be changed when the starting text is wrapped in a marknode.

ltr-rtl

Metadata

Assignees

No one assigned

    Labels

    marks@lexical/mark, comments, annotationstext directionRelated to bidirectional text input (rtl, ltr)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions