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 focus NestedLexicalEditor within Table Cell, changes within nested editor do not save #528

Open
2 tasks done
mlequime opened this issue Jul 9, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@mlequime
Copy link
Contributor

mlequime commented Jul 9, 2024

If you want to ask for support or request features, sponsor the project and contact me over email.

  • I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
  • I have read the documentation and cannot find an answer.

Describe the bug
NestedLexicalEditors within a table cell in the tablePlugin can't be focused. When the focus event is added, the changes within the editor do not save, apparently due to the table cell

Reproduction
https://codesandbox.io/p/sandbox/mdx-editor-base-forked-qk7m7s?file=%2Fsrc%2FApp.tsx%3A34%2C67

NB: The table plugin is throwing an error even with the example in 3.0+ within codesandbox, so this is using version 2.9. This is reproducible however in 3.8.1.

To Reproduce
Steps to reproduce the behavior:

  1. Try to interact with the blue-bordered nestedlexicaleditor within the table cell.
  2. Try to change the value and blur the nested editor.

Expected behavior
It should be possible to focus and edit the value, and changes to the nestededitor should propagate up.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: Chrome, Firefox, Safari

Additional context
I've investigated two potential fixes. The first is registering a focus handler to the NestedLexicalEditor, the second is either lowering the priority of the BLUR command in the TableEditor, or raising the priority of the BLUR command in the NestedLexicalEditor to match.

@petyosi
Copy link
Contributor

petyosi commented Jul 10, 2024

That's a valid problem, I need to think about solving it correctly, maybe your solution is right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants