-
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(Button): ensure onMouseEnter fires when moving from disabled button #13925
fix(Button): ensure onMouseEnter fires when moving from disabled button #13925
Conversation
✅ Deploy Preview for carbon-components-react ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
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! I'm able to see the tooltip after hovering the disabled button to the enabled one.
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.
tested and looks good!
Closes #13815
Adds in a workaround to ensure that
onMouseEnter
fires when the mouse cursor enters the button from abutton
in adisabled
state. I've wrapped theButton
in a wrapperdiv
which setscursor: not-allowed
to mimic the cursor of adisabled
button, and then setpointer-events: none
on the underlying button.Changelog
New
disabled
is defined as aPropType
ofIconButton
so that we can set a proper wrapper class to target via cssPopover
trigger is now wrapper in adiv.cds--tooltip-trigger__wrapper
Testing / Reviewing
Go to
Button --> Test
story and hover from the firstdisabled
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.jsWill remove the story before merging