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

fix: useHover always returns currentTarget #2428

Merged
merged 4 commits into from Oct 8, 2021
Merged

fix: useHover always returns currentTarget #2428

merged 4 commits into from Oct 8, 2021

Conversation

cedeber
Copy link
Contributor

@cedeber cedeber commented Oct 6, 2021

Closes #2355

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

Logging the DOM element from: https://github.com/cedeber/premio/blob/8f0b2301b753528ac79decd3d71aa0e3f40a0445/app-src/components/Menu.tsx#L48

It was easy to see that sometimes a single letter or the emoticon was returned instead of the element which the events are attached to.

🧢 Your Project:

https://github.com/cedeber/premio

snowystinger
snowystinger previously approved these changes Oct 8, 2021
Copy link
Member

@snowystinger snowystinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So fast! Thanks!
I hope you don't mind but I added a test and tried to make the names in other places a little more like the change you made

@cedeber
Copy link
Contributor Author

cedeber commented Oct 8, 2021

Yeah thanks. I also realized I forgot it on the triggerHoverEnd but you were faster than me ;-)

@snowystinger snowystinger added the small review Easy to review PR label Oct 8, 2021
Copy link
Member

@LFDanLu LFDanLu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, confirmed locally that useHover is returning the element that the listeners are attached to consistently with these changes

@LFDanLu LFDanLu merged commit d6b4706 into adobe:main Oct 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
small review Easy to review PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

useHover target is not always "currentTarget" ?
3 participants