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 DefinitionTooltip not opening on first click #17622

Merged

Conversation

frankharkins
Copy link
Contributor

@frankharkins frankharkins commented Oct 1, 2024

Closes #17070

The problem was onFocus opened the tooltip, then the onClick from the same event immediately closed it again.

This PR proposes a fix by changing onClick to onMouseDown, which occurs before onFocus.

Changelog

Changed

  • Fixed bug whereby DefinitionTooltip with openOnHover=false immediately closed the first time it was clicked.

Testing / Reviewing

Open storybook, go to DefinitionTooltip, set openOnHover to false, then click the component.

Screen.Recording.2024-10-01.at.07.43.52.mov

`onClick` -> `onMouseDown` so the action happens before `onFocus`.
Copy link

netlify bot commented Oct 1, 2024

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit f99ebb6
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/66fbc48f540ab50008b5d4e1
😎 Deploy Preview https://deploy-preview-17622--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Oct 1, 2024

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit f99ebb6
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/66fbc48fca3e2e0008d182a9
😎 Deploy Preview https://deploy-preview-17622--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Oct 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.03%. Comparing base (6bd017d) to head (f99ebb6).
Report is 19 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

Copy link
Member

@kennylam kennylam left a comment

Choose a reason for hiding this comment

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

LGTM!

@ariellalgilmore ariellalgilmore added this pull request to the merge queue Oct 1, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 1, 2024
@ariellalgilmore ariellalgilmore added this pull request to the merge queue Oct 2, 2024
Merged via the queue into carbon-design-system:main with commit 204508f Oct 2, 2024
36 checks passed
@frankharkins frankharkins deleted the FH/tooltip-bug branch October 2, 2024 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: DefinitionTooltip is not opening on first click
3 participants