Skip to content
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

useMove: when is onMoveStart fired? #4056

Closed
mischnic opened this issue Feb 13, 2023 · 0 comments · Fixed by #6952
Closed

useMove: when is onMoveStart fired? #4056

mischnic opened this issue Feb 13, 2023 · 0 comments · Fixed by #6952
Labels
documentation Improvements or additions to documentation

Comments

@mischnic
Copy link
Contributor

🙋 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:

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")?

@snowystinger snowystinger added the documentation Improvements or additions to documentation label Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants