-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[lexical-playground] Fix table hover actions button position #7011
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
size-limit report 📦
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a complete fix because there's no scroll event handling (looking forward to #6923 so all of these things can be fixed). A visible button will remain in a fixed position while the table scrolls behind it. Also a bit of a hack because it doesn't use the theme, but it is playground-only code so that's a bit par for the course.
@@ -115,6 +115,19 @@ function TableHoverActionsContainer({ | |||
height: tableElemHeight, | |||
} = (tableDOMElement as HTMLTableElement).getBoundingClientRect(); | |||
|
|||
// Adjust for using the scrollable table container | |||
const parentElement = (tableDOMElement as HTMLTableElement) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A more robust check here would be to compare tableDOMElement
to parentElement = editor.getElementByKey(table.getKey())
- if they are not identical, then the latter is the outermost wrapping node. This is already computed above just not saved to its own variable.
After introducing the getDOMSlot usage, the render coordinates for the table hover actions had to be adjusted.
Before:
Screen.Recording.2025-01-01.at.14.17.56.mov
After:
Screen.Recording.2025-01-01.at.14.17.30.mov