fixed column resizer being broken
This commit is contained in:
parent
caff4ce6fb
commit
06d7ff4d4a
1 changed files with 6 additions and 8 deletions
|
|
@ -500,13 +500,11 @@ export default function ResponsiveTable<T extends Object>(props: Props<T>) {
|
|||
}
|
||||
|
||||
const resizeClick = (event: React.MouseEvent<HTMLDivElement, MouseEvent>, index: number) => {
|
||||
|
||||
let newWidths: number[] = []
|
||||
event.currentTarget.parentElement?.parentElement?.parentElement?.childNodes.forEach(node => {
|
||||
if (node instanceof HTMLElement) {
|
||||
newWidths.push(node.clientWidth)
|
||||
}
|
||||
})
|
||||
const row = event.currentTarget.closest("tr")
|
||||
if (!row) return
|
||||
const cells = Array.from(row.querySelectorAll("th, td"))
|
||||
const offset = (rowSelect ? 1 : 0) + (renderGutter ? 1 : 0)
|
||||
const newWidths = cells.slice(offset).map((cell) => cell.clientWidth)
|
||||
|
||||
rowWidthsRef.current = newWidths
|
||||
dragIndexRef.current = index;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue