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
Dropping a row past the last row of a Table that already has rows makes the dragged row disappear. onInsert/onReorder receive a generated key (e.g. react-aria-27) as e.target.key instead of a row key.
🤔 Expected Behavior?
e.target.key should be the key of the last row, with dropPosition: 'after', so the item is inserted at the end of the list.
😯 Current Behavior
When the pointer moves downward past the last row, e.target.key is the 's auto-generated collection key:
vs. a working drop between rows, where the key is 2. useListData.insertAfter is a no-op for an unknown key, so nothing is inserted — but onDragEnd fires with dropOperation: 'move' and isInternal: false, so the item is removed from the source list and disappears entirely. No error is thrown.
💁 Possible Solution
TreeDropTargetDelegate.getPotentialTargets walks up the target row's parent chain to offer "after the parent" as an alternative drop target. It doesn't check that the ancestor is a row, so for a flat table the last row's parent — the <TableBody> node — becomes a second potential target, and downward movement escalates to it in selectTarget. Only pushing ancestor targets for nodes of type 'item' fixes it.
🔦 Context
Drag and drop between two tables silently loses data — the user sees the row vanish from both lists with no error.
🖥️ Steps to Reproduce
Open the "Multiple positions" example on https://react-spectrum.adobe.com/react-aria/dnd.html and switch to the Table variant.
Drag a row from the first table over the second table.
Move the pointer below the last row.
Drop. The row disappears from both tables.
Provide a general summary of the issue here
Dropping a row past the last row of a
Tablethat already has rows makes the dragged row disappear.onInsert/onReorderreceive a generated key (e.g.react-aria-27) ase.target.keyinstead of a row key.🤔 Expected Behavior?
e.target.keyshould be the key of the last row, withdropPosition: 'after', so the item is inserted at the end of the list.😯 Current Behavior
When the pointer moves downward past the last row, e.target.key is the 's auto-generated collection key:
{"items":[{"kind":"text","types":{}}],"dropOperation":"move", "target":{"type":"item","key":"react-aria-27","dropPosition":"after"}}vs. a working drop between rows, where the key is 2.
useListData.insertAfteris a no-op for an unknown key, so nothing is inserted — butonDragEndfires withdropOperation: 'move'andisInternal: false, so the item is removed from the source list and disappears entirely. No error is thrown.💁 Possible Solution
TreeDropTargetDelegate.getPotentialTargetswalks up the target row's parent chain to offer "after the parent" as an alternative drop target. It doesn't check that the ancestor is a row, so for a flat table the last row's parent — the<TableBody>node — becomes a second potential target, and downward movement escalates to it inselectTarget. Only pushing ancestor targets for nodes of type'item'fixes it.🔦 Context
Drag and drop between two tables silently loses data — the user sees the row vanish from both lists with no error.
🖥️ Steps to Reproduce
Open the "Multiple positions" example on https://react-spectrum.adobe.com/react-aria/dnd.html and switch to the Table variant.
Drag a row from the first table over the second table.
Move the pointer below the last row.
Drop. The row disappears from both tables.
chrome_znza1IxWUV.mp4
Version
rac 1.20
What browsers are you seeing the problem on?
Chrome