Move table row/column insertion controls to a floating menu (#8409) - #8416
Move table row/column insertion controls to a floating menu (#8409)#8416r4-rahul123 wants to merge 3 commits into
Conversation
|
Caution The Volto Team has suspended its review of new pull requests from first-time contributors until the release of Plone 7, which is preliminarily scheduled for the second quarter of 2026. Thanks for submitting your first pull request! You are awesome! 🤗 If you haven't done so already, read Welcome to the Plone community! 🎉 |
| cell: 0, | ||
| }); | ||
| const tableRef = useRef(null); | ||
| const [toolbarTop, setToolbarTop] = useState(-32); |
There was a problem hiding this comment.
-32 and -34 are fixed numbers. If the CSS changes the button height, it will cause issues. The offset can be calculated using only CSS, based on the toolbar's actual height. Something like this:
.block.table {
--toolbar-gap: 2px;
.toolbar {
top: 0;
transform: translate(-50%, calc(-100% - var(--toolbar-gap)));
transition: top 0.15s ease-in-out;
}
}This way, toolbarTop is used solely to define the top position (which line the toolbar should align with).
| if (rowEl) { | ||
| setToolbarTop(rowEl.offsetTop - 34); | ||
| } | ||
| }, [selected, selectedCell, data.table]); |
There was a problem hiding this comment.
We can rely solely on:
selectedCell.row, selected, and data.table?.hideHeaders
to avoid unnecessary re-renders.
b65c34d to
52069d1
Compare
|
Hi @wesleybl, Thank you for the review and helpful suggestions!
All lint and unit tests are passing and the branch is up to date with |
Closes #8409
Summary of changes
TableBlockEdit.jsx) so that the row and column insertion/deletion controls float contextually above the currently selected row rather than staying fixed at the top of the table.8409.feature).