Skip to content

Bug: Lexical Playground bug & Lexical internal logic bug in every lexical version #5202

@youngkyo0504

Description

@youngkyo0504

Lexical version: every version

Steps To Reproduce

2023-11-04.10.44.12.mov
  1. select 20px in toolbar
  2. click editor

Link to code example:

The current behavior

  • reset default fontSize

The expected behavior

  • keep current style

I found what makes bug. onSelectionChange has below logic.

        if (
          currentTimeStamp < timeStamp + 200 &&
          anchor.offset === lastOffset &&
          anchor.key === lastKey
        ) {
          selection.format = lastFormat;
          selection.style = lastStyle;
      }

If conditional statement is true, It works expected. but currentTimeStamp < timeStamp + 200 is false.
What is the intention of this code??

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions