You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TypeError: Cannot read properties of undefined (reading 'getAttribute') on column drag #288
Dragging a column header in InfiniteTable throws an uncaught TypeError every time. The error fires inside the library's own drag event handler — no user code is involved in the crash path.
Error
TypeError: Cannot read properties of undefined (reading 'getAttribute')
at @infinite-table_infinite-react.js:5570:94
at @infinite-table_infinite-react.js:8476:9
at executeDispatch (react-dom-client.js:9141:5)
at runWithFiberInDEV (react-dom-client.js:851:66)
at processDispatchQueue (react-dom-client.js:9167:27)
at react-dom-client.js:9454:5
at batchedUpdates$1 (react-dom-client.js:2044:12)
at dispatchEventForPluginEventSystem (react-dom-client.js:9240:4)
at dispatchEvent (react-dom-client.js:11319:29)
at dispatchDiscreteEvent (react-dom-client.js:11301:56)
Root cause (found in index.dev.mjs)
In onDragItemPointerDown (~line 8858 of index.dev.mjs), after finding the drag item ID from the event target, the code does:
constdragIndex=draggableItems.findIndex((item)=>item.id===dragItemId2);// dragIndex can be -1 if the dragged column is not found in draggableItemsconstdragItem=draggableItems[dragIndex];constdragItemNode=dragItems[dragIndex].getAttribute(DRAG_ITEM_ATTRIBUTE)// CRASH: dragItems[-1] is undefined===`${dragItemId2}`
? dragItems[dragIndex]
: dragItems.find((node)=>node.getAttribute(DRAG_ITEM_ATTRIBUTE)===`${dragItemId2}`);
When findIndex returns -1 (the dragged column is not found in draggableItems), dragItems[-1] is undefined and calling .getAttribute() on it throws.
There is no null/bounds check before accessing dragItems[dragIndex].
Fix
Add a guard before the dragItems[dragIndex] access:
Activity
radubrehar commentedon Jul 6, 2026
thanks for reporting, we're fixing it and will publish a patch very soon
radubrehar commentedon Jul 6, 2026
Should be fixed in
8.0.5radubrehar commentedon Sep 3, 2026
@marynaozirska did
8.0.5fix it for you?