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(Button): ensure onMouseEnter fires when moving from disabled button #13925

Merged

Conversation

tw15egan
Copy link
Collaborator

@tw15egan tw15egan commented Jun 5, 2023

Closes #13815

Adds in a workaround to ensure that onMouseEnter fires when the mouse cursor enters the button from a button in a disabled state. I've wrapped the Button in a wrapper div which sets cursor: not-allowed to mimic the cursor of a disabled button, and then set pointer-events: none on the underlying button.

Changelog

New

  • disabled is defined as a PropType of IconButton so that we can set a proper wrapper class to target via css
  • The Popover trigger is now wrapper in a div.cds--tooltip-trigger__wrapper

Testing / Reviewing

Go to Button --> Test story and hover from the first disabled button to the enabled button and you should see the Tooltip appear. Compare to here: https://codesandbox.io/s/nifty-bassi-bkwmng?file=/src/index.js

Will remove the story before merging

@tw15egan tw15egan requested a review from a team as a code owner June 5, 2023 16:18
@netlify
Copy link

netlify bot commented Jun 5, 2023

Deploy Preview for carbon-components-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 1b9cf38
🔍 Latest deploy log https://app.netlify.com/sites/carbon-components-react/deploys/647f65680ee5c100082c861f
😎 Deploy Preview https://deploy-preview-13925--carbon-components-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 settings.

@tw15egan tw15egan requested a review from a team as a code owner June 5, 2023 16:22
@netlify
Copy link

netlify bot commented Jun 5, 2023

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit e441180
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/647e0adbc6a2520009f015a0
😎 Deploy Preview https://deploy-preview-13925--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 settings.

@netlify
Copy link

netlify bot commented Jun 5, 2023

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 1b9cf38
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/647f65681f70b10008de8b9b
😎 Deploy Preview https://deploy-preview-13925--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 settings.

Copy link
Contributor

@guidari guidari left a comment

Choose a reason for hiding this comment

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

LGTM! I'm able to see the tooltip after hovering the disabled button to the enabled one.

Copy link
Contributor

@andreancardona andreancardona left a comment

Choose a reason for hiding this comment

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

tested and looks good!

@kodiakhq kodiakhq bot merged commit 12c76c9 into carbon-design-system:main Jun 6, 2023
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]: onMouseLeave event does not work on the disabled button
3 participants