react-spectrum
react-spectrum copied to clipboard
feat: event coordinates
Closes https://github.com/adobe/react-spectrum/issues/2031
Related https://github.com/adobe/react-spectrum/issues/1998.
Add clientX and clientY positioning to onPress and onHover events for implementing ripple or wave effect.
β Pull Request Checklist:
- [x] Included link to corresponding React Spectrum GitHub Issue.
- [x] Added/updated unit tests and storybook for this change (for new code or code which already has tests).
- [x] Filled out test instructions.
- [x] Updated documentation (if it already exists for this component).
- [ ] Looked at the Accessibility Practices for this feature - Aria Practices
π Test Instructions:
- Open the storybook for the
Button - Defaultcomponent. - Clicking on different positions of the target element.
- Check the coordinates
x,ydisplayed in the Actions panel. - When triggering the event using the keyboard, the coordinates will be
0,0.
π§’ Your Project:
Thanks for the PR!
First, for the build to pass you'll need to sign the CLA, then close and re-open this PR to let it refresh.
And it looks like there are some tests failing. I think some just need to include updating some assertions to have the newly returned values. You can run yarn jest to see which ones are failing.
Sorry for the duplicate. What is the status of this PR?
Oops, sorry, I almost forgot about this PR πΆβπ«οΈ I'll try to complete it as soon as I have some time, thanks for the reminder π«‘
On the contrary, thanks to you.
I have a question. The only thing this PR is missing is replacing the default value of (0;0) to the center of the target?
Any update on this.
Any update? @tianenpang
any update?
Hey any update?
If you'd like, you may pick up where the original author left off. I don't think they will mind.
If you'd like, you may pick up where the original author left off. I don't think they will mind.
Alright, the only thing missing is resolving the merge conflict or?
There's a little more work, see https://github.com/adobe/react-spectrum/pull/4267#discussion_r1154692307
Thank you, will try my best :)
Hey I have created a PR, this is my first so I hope I have not everything done wrong π . Thx
Closing since https://github.com/adobe/react-spectrum/pull/6482 was merged