Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
youngkyo0504 opened this issue Nov 4, 2023 · 2 comments · Fixed by #5292
Closed

Comments

@youngkyo0504
Copy link
Contributor

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??

@youngkyo0504 youngkyo0504 changed the title Bug: Lexical Playground bug & Lexical internal logic bug Bug: Lexical Playground bug & Lexical internal logic bug in every lexical version Nov 4, 2023
@acywatson
Copy link
Contributor

#1989

You can use Git Blame to see the commit that introduced a diff, which can help you understand the intent.

@youngkyo0504
Copy link
Contributor Author

@acywatson thank you!
I have created a pull request. Could you please review my commit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants