-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation
Description
🙋 Documentation Request
https://react-spectrum.adobe.com/react-aria/useMove.html#features
A move interaction starts when a user presses down with a mouse or their finger on the target, and ends when they lift their pointer.
This sounds like onMoveStart
behaves like onPressStart
. But in reality it's called just before the first onMove
event:
react-spectrum/packages/@react-aria/interactions/src/useMove.ts
Lines 58 to 78 in 6013307
if (!state.current.didMove) { | |
state.current.didMove = true; | |
onMoveStart?.({ | |
type: 'movestart', | |
pointerType, | |
shiftKey: originalEvent.shiftKey, | |
metaKey: originalEvent.metaKey, | |
ctrlKey: originalEvent.ctrlKey, | |
altKey: originalEvent.altKey | |
}); | |
} | |
onMove({ | |
type: 'move', | |
pointerType, | |
deltaX: deltaX, | |
deltaY: deltaY, | |
shiftKey: originalEvent.shiftKey, | |
metaKey: originalEvent.metaKey, | |
ctrlKey: originalEvent.ctrlKey, | |
altKey: originalEvent.altKey | |
}); |
So I guess the current behaviour is correct and the docs are wrong (should instead say something like "it starts when the user first moves the pointer after pressing down")?
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation
Type
Projects
Status
✅ Done