-
Notifications
You must be signed in to change notification settings - Fork 14
AR-2016 Allow Tooltip
to wrap a Button
that is disabled
#298
AR-2016 Allow Tooltip
to wrap a Button
that is disabled
#298
Conversation
7b9cf6e
to
81f5e35
Compare
"onClick", | ||
// If we're overriding the default disabled behavior, then strip | ||
// it out from the props we'll pass to the element. | ||
overrideDisabledBehavior ? "disabled" : "", |
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.
Is there an aria prop we should/could pass to make sure the button is still semantically disabled?
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.
Only kind-of. We can use aria-disabled
, but this will only provide special behavior for screen readers. I'll add it.
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.
ooh nice, thats probably where it matters most so thats perfect :)
8413d9e
to
0973670
Compare
… Tooltip We'll need this so components can have special behavior if they live inside of a Tooltip
0973670
to
cafa14b
Compare
"onClick", | ||
// If we're overriding the default disabled behavior, then strip | ||
// it out from the props we'll pass to the element. | ||
overrideDisabledBehavior ? "disabled" : "", |
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.
ooh nice, thats probably where it matters most so thats perfect :)
🚀 PR was released in |
This works by capturing pointer events to signal that the cursor is over the button and then applying
disabled
styles directly to thebutton
element and removing thedisabled
property so that tippy.js will show the tooltip. I went with this approach because then we can still test fordisabled
buttons.AR-2016
Testing to see how this looks in Studio UI https://github.com/mdg-private/studio-ui/pull/3700
📦 Published PR as canary version:
8.12.1-canary.298.7907.0
✨ Test out this PR locally via:
npm install @apollo/space-kit@8.12.1-canary.298.7907.0 # or yarn add @apollo/space-kit@8.12.1-canary.298.7907.0