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: Can't escape inline code #7025

Open
olafsulich opened this issue Jan 8, 2025 · 3 comments
Open

Bug: Can't escape inline code #7025

olafsulich opened this issue Jan 8, 2025 · 3 comments
Labels

Comments

@olafsulich
Copy link

Lexical version:

v0.23.0

Steps To Reproduce

  1. Open the lexical playground
  2. Type one backtick, add some text, type the second backtick - the inline code node should be created
  3. Without leaving the inline code, move to the center of it, add space with some more text
  4. You can't escape the inline code, either with the space (the default behavior) or the right arrow
Screen.Recording.2025-01-08.at.11.31.24.mov

The issue exists only when you've not escaped the code before. An example of it working fine (I was able to escape with the right arrow):

Screen.Recording.2025-01-08.at.11.36.39.mov

The current behavior

Can't escape the inline code

The expected behavior

Can escape the inline code

Impact of fix

It's an edge case, sure, but it could be quite frustrating because you have to delete the whole code node to eliminate it.

@etrepum
Copy link
Collaborator

etrepum commented Jan 9, 2025

Inline code is just a text format for TextNode, like bold or italic, if you click the < > button in the toolbar it toggles the code format off

@olafsulich
Copy link
Author

Sure, but it would be great to have an option to not use the toolbar button, for example in my case, I have an option to hide the toolbar

@etrepum
Copy link
Collaborator

etrepum commented Jan 9, 2025

Yes, I’m just explaining the details of the problem for whoever works on it or if you want to try and work around it. It gets stuck because there’s just one text node that doesn’t have any special mode flags like token or segment, it’s not super easy to fix because you also can’t put an empty text node next to it with no code format, because that would just get removed during reconciliation. The editor doesn’t really see it any differently than bold text or blue text, you can’t “escape” that without explicitly changing the format either.

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

No branches or pull requests

2 participants