Closed LimChorngUan closed 13 hours ago
Clearing selection onBlur is a known issue for Lexical, and I've opened this issue to track it there: https://github.com/facebook/lexical/issues/6622
However, some buttons appearing initially enabled even before the editor receives focus seems like a bug on our end. I'm going to rename this issue to track that part of the problem.
Thanks for reporting!
Awesome thanks so much!
I just looked at this issue again. When you talked about enabled and disabled I thought you meant active and inactive (the color that appears when the selection has, for example, subscript, or bold, etc.).
The current behavior is that the X₂ and X² buttons appear enabled even if nothing has been selected yet, because in case the button is pressed the editor is focused and the formatting is applied on the first paragraph, which seems to me a reasonable heuristic and that I think other text editors follow.
I do recognize that the dropdown and buttons could follow the same behavior for consistency, but I don't think this reaches “bug” status. I'm going to close this issue, but I can check a PR if this is important to you and you want to contribute. 😁
Describe the Bug
Toolbar items in
FixedToolbarFeature
are not disabled when the lexical editor is not in focused.Actual Behavior:
Expected Behavior: All toolbar items should be disabled when the editor is unfocused.
Reproduction Steps
lexicalEditor
in the e.g. PostCollection withFixedToolbarFeature
and other featuresWhich area(s) are affected? (Select all that apply)
area: ui, plugin: richtext-lexical
Environment Info
Payload: 3.0.0-beta.116 Node.js: ^18.20.2 || >=20.9.0 Next.js: 15.0.0-canary.173