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

[lexical-plaintext] Feature: add escape key handler #5991

Merged
merged 1 commit into from
May 6, 2024

Conversation

jeffreyclu
Copy link
Contributor

@jeffreyclu jeffreyclu commented Apr 30, 2024

Description

Adds the same escape key handler to the plain text package as exists in lexical/richtext.

Closes: #5922

Test plan

Before

In the plaintext playground, pressing Esc doesn't blur the editor.

Screen.Recording.2024-04-30.at.11.02.59.AM.mov

After

In the plaintext playground, pressing Esc blurs the editor.

Screen.Recording.2024-04-30.at.11.02.32.AM.mov

Copy link

vercel bot commented Apr 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lexical ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 30, 2024 2:57pm
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 30, 2024 2:57pm

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 30, 2024
@jeffreyclu jeffreyclu changed the title add escape key handler for plaintext plugin [lexical-plaintext] Feature: add escape key handler Apr 30, 2024
@jeffreyclu jeffreyclu marked this pull request as ready for review April 30, 2024 15:04
Copy link
Contributor

@StyleT StyleT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the contribution 🙌

@StyleT StyleT merged commit ac97dfa into facebook:main May 6, 2024
46 checks passed
@sqs
Copy link

sqs commented May 26, 2024

(First, thank you for the Lexical editor. It's the best!)

Why is it desirable for Esc to blur the editor? That is not how most other text editors work. It makes sense for web browser location bars and modal text inputs, but not for multi-line document editor fields.

Here is an example of a situation where Esc blurring can be frustrating to the user:

  1. Type @ and then realize you don't want to add an @-mention.
  2. Press Esc a few times because usually Esc is idempotent.
  3. Oops! Now you have not only exited the @-mention menu, but you've also blurred the editor and can't resume typing.
CleanShot.2024-05-26.at.14.55.40.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants