facebook / lexical

Lexical is an extensible text editor framework that provides excellent reliability, accessibility and performance.
https://lexical.dev
MIT License
19.65k stars 1.67k forks source link

Wonder: possible conflict between Table Plugins #6727

Open roeycohen opened 3 weeks ago

roeycohen commented 3 weeks ago

Working with the table plugins on my adjusted code, I found the following issue:

The button of TableActionMenuPlugin disappears when I hover the TableCellResizer resizing elements or when the TableHoverActionsPlugin plugin changes the view.

This seems to happen because both plugins are calling editor.update(...) https://github.com/facebook/lexical/blob/2e64bfc5ca1b08c6636d121b77e2d1e733654d66/packages/lexical-playground/src/plugins/TableCellResizer/index.tsx#L110 https://github.com/facebook/lexical/blob/2e64bfc5ca1b08c6636d121b77e2d1e733654d66/packages/lexical-playground/src/plugins/TableHoverActionsPlugin/index.tsx#L65

changing it to editor..read(...) seems to resolve the problem...

I believe it's related to the following function, but I couldn't understand why it doesn't break on the playground: https://github.com/facebook/lexical/blob/2e64bfc5ca1b08c6636d121b77e2d1e733654d66/packages/lexical-playground/src/plugins/TableActionMenuPlugin/index.tsx#L640

Thanks, Roey

etrepum commented 3 weeks ago

Hard to say unless you can show something that reproduces the problem with the current version of lexical, ideally in the playground. The playground is built from the latest commit on main so it may have fixes (either in one of lexical's packages or the playground itself) that you haven't yet integrated into your code. You could try using the latest nightly build of lexical's packages in your project to see if you can still reproduce the problem.