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] Nested NestedLexicalEditor instances within table cell fail to update parentEditor MDX #570

Closed
2 tasks done
mlequime opened this issue Aug 22, 2024 · 1 comment
Closed
2 tasks done
Labels
bug Something isn't working

Comments

@mlequime
Copy link
Contributor

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
A NestedLexicalEditor within a NestedLexicalEditor (to any depth) will fail to update with updateMdastNode when within a table cell.

This is due to the priority on the NESTED_EDITOR_UPDATED_COMMAND within TableEditor, it effectively captures the dispatched event before the change has been able to propagate, and sets state with the older value.

Lowering this state to match NestedLexicalEditor (COMMAND_PRIORITY_EDITOR) fixes the issue.

Reproduction
Working on adding an example

To Reproduce
Steps to reproduce the behavior:

  1. Create a directive with a nested lexical editor and some action that sets its attributes with updateMdastNode
  2. Include this within an instance of itself, within a table cell
  3. Button will have no action, but button on the parent will work as it's a direct child of the TableCell

Expected behavior
Updating state within any depth should work

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

Screenshot 2024-08-22 at 10 46 25

Desktop (please complete the following information):

  • OS: [e.g. MacOS, Windows] - Windows can act funny sometimes.
  • Browser [e.g. Chrome, Safari]

Additional context
Will raise a merge request with the fix

@mlequime mlequime added the bug Something isn't working label Aug 22, 2024
@petyosi
Copy link
Contributor

petyosi commented Aug 22, 2024

The diagram makes a lot of sense to me. Happy to accept a PR, I remember you were doing something in the space.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment