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: Typeahead menu does not respect read-only mode #7160

Closed
RobHannay opened this issue Feb 10, 2025 · 0 comments · Fixed by #7185
Closed

Bug: Typeahead menu does not respect read-only mode #7160

RobHannay opened this issue Feb 10, 2025 · 0 comments · Fixed by #7185
Labels

Comments

@RobHannay
Copy link
Contributor

RobHannay commented Feb 10, 2025

Lexical version: Assumed 0.24.0 from package here

The common theme appears to be the LexicalTypeaheadMenuPlugin component

Steps To Reproduce

Emoji example:

  1. Open Lexical Playground example at https://playground.lexical.dev/
  2. Ensure there's a colon with a space before it
  3. Set playground to read-only mode
  4. Focus cursor after colon
  5. Choose an emoji from the list

Same for @-mentions.

Link to code example:

Screen.Recording.2025-02-10.at.14.20.43.mov
Screen.Recording.2025-02-10.at.14.17.08.mov

https://playground.lexical.dev/

The current behavior

Emoji/mentions picker opens and allows insertion/modification of nodes

The expected behavior

No picker should be present, or at least no emoji/mention should be insertable

Impact of fix

Ensure true compliance of "read only" mode

@RobHannay RobHannay changed the title Bug: Possible to insert emoji in read-only mode in Playground Bug: Typeahead menu does not respect read-only mode Feb 10, 2025
@etrepum etrepum added good first issue Good for newcomers playground labels Feb 10, 2025
kirandash added a commit to bgwebagency/lexical that referenced this issue Feb 16, 2025
- Add read-only mode check before showing typeahead menu
- Add editable state listener to close menu when editor becomes read-only
- Ensures emoji/mentions picker respects editor's read-only state

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

Successfully merging a pull request may close this issue.

2 participants