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

Tooltips on disabled actions in react-table #5127

Closed
wsamsnyder opened this issue Nov 11, 2020 · 5 comments
Closed

Tooltips on disabled actions in react-table #5127

wsamsnyder opened this issue Nov 11, 2020 · 5 comments

Comments

@wsamsnyder
Copy link

Describe the issue. What is the expected and unexpected behavior?
I have a use case where I would like to disable an action in the action's dropdown on a Table row and display a tooltip on why it is disabled. Looking through similar issues, mainly #2470 and #4581, the workaround for standard DropDownItems is to wrap the it in a tooltip; this is not viable because the Table is generating the DropDownItems.

Please provide the steps to reproduce. Feel free to link CodeSandbox or another tool.
Passing tooltip will display the tool tip, as long as the action isn't diabled. Passing isDisabled will create the desired button behavoir but will also disable the tooltip.

Is this a bug or enhancement? If this issue is a bug, is this issue blocking you or is there a work-around?
Bug, Blocking.

@jschuler
Copy link
Collaborator

Somewhat of a workaround, but you can add some style to the action/dropdown item to see the tooltip

{
        title: 'Some action',
        onClick: (event, rowId, rowData, extra) => console.log('clicked on Some action, on row: ', rowId),
        tooltip: 'Hello',
        isDisabled: true,
        style: {
          pointerEvents: 'auto',
          cursor: 'default'
        }
      },

@jgiardino
Copy link
Collaborator

We also require this functionality. I will pass along the work-around, but I also expect this tooltip to be available when using the keyboard to interact with the menu. Without testing this work-around, I can't say this solution isn't keyboard accessible. But when testing the work-around for #4581, this solution did not support keyboard accessibility.

@jgiardino
Copy link
Collaborator

I just realized I could test this using the PF examples 🤪 and the workaround is actually keyboard accessible.

@wsamsnyder
Copy link
Author

I was not able to work my way back to this section of the code until recently and this workaround worked perfectly. Thanks @jschuler!

@jschuler
Copy link
Collaborator

Closing since the workaround is good for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants