-
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
[OverflowMenuItem] itemText cannot put Tooltip component #7088
Comments
@dawang021 it is really helpful if you fill out the issue template so we can help you get sorted out properly. Do you have a link to a reproducible example on CodeSandbox? I am unable to reproduce the problem on our end: https://react.carbondesignsystem.com/?path=/story/datatable--with-overflow-menu |
@tw15egan please take a look at this demo in sandbox: https://codesandbox.io/s/overflow-menu-with-tooltip-8iykr?file=/src/index.js |
I don't believe Please see this link for more info: https://www.carbondesignsystem.com/components/overflow-menu/usage#formatting |
@tw15egan But it works in lower version https://codesandbox.io/s/overflow-menu-with-tooltip-working-well-hsdwo?file=/src/index.js. The reason why I want to add Tooltip in OverflowMenuItem is OverflowMenuItem can be disabled, so I want to let users know why this OverflowMenuItem is disabled. |
OverflowMenu items that are disabled are not in the tab order, so a keyboard user would not be able to navigate to this item and it would cause an a11y violation. That is why this pattern is not recommended. |
What is your recommendation/implementation using I don't think there isn't a need to not let users know the reason for disabled actions. |
What action are they trying to take that might be disabled? Could any type of UX pattern be used outside of the overflow menu to let the user know why they cannot do something? Does that item even need to be shown if it is not a viable action? Posting user flows here would help our team give guidance around this situation |
In IBM cloud VPC load balancer backend pools, we give the reason why this pool is not able to delete. |
Can you try setting |
I don't think TooltipDefinition would be valid DOM since it would be nesting a button within a button (maybe it would work if you add an <OverflowMenuItem
href="#" // renders <a> rather than <button>
itemText={
<TooltipDefinition tooltipText="some tooltip text">
Option 2
</TooltipDefinition>
}
/> your best bet until the Carbon interactive tooltip gets overhauled is probably using <OverflowMenuItem
requireTitle
itemText="Option 2"
title="some tooltip text"
/> edit: looks like custom |
related #6605 |
hey @dawang021, thanks for creating the issue. What you're trying to accomplish here with Tooltip and OverflowMenu isn't a supported pattern. This is most likely going to create an accessibility violation. |
What package(s) are you using?
carbon-components
carbon-components-react
Detailed description
Steps to reproduce the issue
Sandbox reproduce: https://codesandbox.io/s/overflow-menu-with-tooltip-8iykr?file=/src/index.js
Additional information
The text was updated successfully, but these errors were encountered: