-
Notifications
You must be signed in to change notification settings - Fork 97
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
Feat/add on arrow release #145
base: main
Are you sure you want to change the base?
Conversation
@yujhenchen: Thanks for opening a PR with this suggestion - We'll review it as soon as possible and let you know. |
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.
Hi! Thanks for the contribution. I can see that it might be useful to have arrow release events as well. Looks good to me.
Please address the Prettier comment below, otherwise all good :)
src/SpatialNavigation.ts
Outdated
? isIncrementalDirection | ||
? siblingCutoffCoordinate >= currentCutoffCoordinate // horizontal LTR next | ||
: siblingCutoffCoordinate <= currentCutoffCoordinate // horizontal LTR previous | ||
: isIncrementalDirection | ||
? siblingCutoffCoordinate <= currentCutoffCoordinate // horizontal RTL next | ||
: siblingCutoffCoordinate >= currentCutoffCoordinate; // horizontal RTL previous |
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.
Please make sure to run Prettier on your code. All these small changes will be changed back next time we run Prettier. We will automate it with Husky in the future, but for now please only include changes that are relevant to your feature :)
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.
Hi @asgvard
Thanks for your review :) I just reverted these unrelated changes. Could you take another quick look to see if everything is good to merge?
Regarding adding Husky, I have used it before in another project and it is really convenient. Can I try and create another issue and PR to deal with it 😀 ?
Resolves #143
Based on this issue: Need onArrowRelease function param for useFocusable
Summary
Implemented the
onArrowRelease
callback function in theuseFocusable
hook, allowing users to pass a custom function that is triggered when an arrow key is released.Usage
Demo
A
ProgressBar
component that allows progress to be updated by long-pressing the right arrow key.ProgressBar.mp4
Looking forward to any feedback on the changes!