react-spectrum icon indicating copy to clipboard operation
react-spectrum copied to clipboard

feat: event coordinates

Open tianenpang opened this issue 2 years ago β€’ 6 comments

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 - Default component.
  • Clicking on different positions of the target element.
  • Check the coordinates x,y displayed in the Actions panel.
  • When triggering the event using the keyboard, the coordinates will be 0,0.

🧒 Your Project:

Button drip effect - NextUI.

tianenpang avatar Mar 26 '23 14:03 tianenpang

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.

reidbarber avatar Mar 27 '23 14:03 reidbarber

Sorry for the duplicate. What is the status of this PR?

GermanJablo avatar Sep 21 '23 18:09 GermanJablo

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 🫑

tianenpang avatar Sep 22 '23 00:09 tianenpang

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?

GermanJablo avatar Dec 27 '23 00:12 GermanJablo

Any update on this.

eashish93 avatar Jan 12 '24 19:01 eashish93

Any update? @tianenpang

wrong7 avatar Jan 25 '24 17:01 wrong7

any update?

hlege avatar May 31 '24 08:05 hlege

Hey any update?

thmsfchtnr avatar Jun 01 '24 21:06 thmsfchtnr

If you'd like, you may pick up where the original author left off. I don't think they will mind.

snowystinger avatar Jun 02 '24 00:06 snowystinger

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?

thmsfchtnr avatar Jun 02 '24 08:06 thmsfchtnr

There's a little more work, see https://github.com/adobe/react-spectrum/pull/4267#discussion_r1154692307

snowystinger avatar Jun 02 '24 09:06 snowystinger

Thank you, will try my best :)

thmsfchtnr avatar Jun 02 '24 09:06 thmsfchtnr

Hey I have created a PR, this is my first so I hope I have not everything done wrong πŸ˜…. Thx

thmsfchtnr avatar Jun 02 '24 19:06 thmsfchtnr

Closing since https://github.com/adobe/react-spectrum/pull/6482 was merged

yihuiliao avatar Jun 10 '24 22:06 yihuiliao