-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
useDrag: add support for isDisabled #6254
Conversation
Build successful! 🎉 |
Build successful! 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was thinking about what should happen if the drag target becomes disabled in the middle of a drag operation (e.g. keyboard dnd). I think the current behavior is fine (aka you can still complete the drop part of your current drag operation) but open question for the team in case there were any other opinions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we would have to stop the drag session, and that would be a bit weird. Open to implementing that though, if thats what we want to do.
Build successful! 🎉 |
Build successful! 🎉 |
## API Changes
unknown top level export { type: 'any' } @react-aria/dndDragOptions DragOptions {
getAllowedDropOperations?: () => Array<DropOperation>
getItems: () => Array<DragItem>
hasDragButton?: boolean
+ isDisabled?: boolean
onDragEnd?: (DragEndEvent) => void
onDragMove?: (DragMoveEvent) => void
onDragStart?: (DragStartEvent) => void
preview?: RefObject<DragPreviewRenderer>
it changed:
|
For parity with
useDrop
anduseClipboard
✅ Pull Request Checklist:
📝 Test Instructions:
Check new story and tests
🧢 Your Project:
RSP