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
The documentation says that getKeysForDrag returns the selected items.
I want to overwrite this function to drag and drop selected items separately.
Even though I overwrite it, drag and drop don't work as expected.
GridList.bug.mp4
Overwriting getKeysForDrag, full example in "Steps to reproduce"
dragAndDropHooks.useDraggableCollectionState=functionuseDraggableCollectionStateOverride(props: DraggableCollectionStateOpts){constdraggableHook=useDraggableCollectionState({
...props,
...options,}asDraggableCollectionStateOptions);draggableHook.getKeysForDrag=function(key: string){returnnewSet([key]);//Just the clicked item be a key for drag};returndraggableHook;};
🤔 Expected Behavior?
Items of a GridList to be reordered (drag and drop) separately
😯 Current Behavior
All the selected keys are dragged
💁 Possible Solution
I'm not sure, I didn't realize looking at the source code where onReorder evaluates the event.keys
Provide a general summary of the issue here
The documentation says that
getKeysForDragreturns the selected items.I want to overwrite this function to drag and drop selected items separately.
Even though I overwrite it, drag and drop don't work as expected.
GridList.bug.mp4
Overwriting
getKeysForDrag, full example in "Steps to reproduce"🤔 Expected Behavior?
Items of a GridList to be reordered (drag and drop) separately
😯 Current Behavior
All the selected keys are dragged
💁 Possible Solution
I'm not sure, I didn't realize looking at the source code where
onReorderevaluates theevent.keys🔦 Context
No response
🖥️ Steps to Reproduce
Repository
You can just clone and run this repository:
https://github.com/JonRC/react-aria-grid-list-bug
Code
Here is the code used in the repository below if you want reproduce by your own
Version
"react-aria-components": "^1.8.0"
What browsers are you seeing the problem on?
Chrome
If other, please specify.
No response
What operating system are you using?
Linux, Ubuntu
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response