-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 DefinitionTooltip not opening on first click #17622
Fix DefinitionTooltip not opening on first click #17622
Conversation
`onClick` -> `onMouseDown` so the action happens before `onFocus`.
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for v11-carbon-react ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #17622 +/- ##
=======================================
Coverage 77.03% 77.03%
=======================================
Files 408 408
Lines 13993 13994 +1
Branches 4349 4301 -48
=======================================
+ Hits 10779 10780 +1
- Misses 3041 3042 +1
+ Partials 173 172 -1 ☔ View full report in Codecov by Sentry. |
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.
LGTM!
204508f
Closes #17070
The problem was
onFocus
opened the tooltip, then theonClick
from the same event immediately closed it again.This PR proposes a fix by changing
onClick
toonMouseDown
, which occurs beforeonFocus
.Changelog
Changed
DefinitionTooltip
withopenOnHover=false
immediately closed the first time it was clicked.Testing / Reviewing
Open storybook, go to
DefinitionTooltip
, setopenOnHover
tofalse
, then click the component.Screen.Recording.2024-10-01.at.07.43.52.mov