Wrapper for TableNode #6669
Unanswered
richardaum
asked this question in
Q&A
Replies: 1 comment
-
|
I have also encountered this problem. May I ask if you have found a solution to it? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! This is my first time here, and first of all I'd like to thank you all for the incredible work here.
So here I am, trying to build a wrapper for a table so I can customize it adding extra features, cool behavior, etc. The way I thought of it was creating a
TableWrapperas aElementNodewith arelativeposition, so the elements inside the table can be positioned properly:By creating the wrapper as an
ElementNode, it means it is selectable, specially when navigating using the keyboard, which breaks the keyboard navigation that's already implemented in Lexical, making things like being able to add text directly inside the wrapper. I'd like to Lexical think of theTableWrapperas an "unselectable element" but still haveNodechildren - so when it's selected using the keyboard when navigating up it selects its previous sibling instead of the table's one.I've tried to play around my own keyboard listeners and I could overcome going from inside to outside the table by using some code from
LexicalTableSelectionHelpersfunctions like a changed version of thoseisExitingTableAnchorand$handleTableExit. But when it comes to going from outside to inside the table, things get complicated which makes the same logic to not work.By the way, I took a look on how a similar feature is made on Playground, but it's relying on
mousemove, bounding rects, x/y... I'm looking for something more close to a relative/absolute approach without relying on tracking the TableNode look for they actual positioning by using JS.That journey made me think, maybe I'm overcomplicating this implementation and maybe there is another thing I could do to my
TableWrapperto make it unselectable/skipable/invisible to Lexical.Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions