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

[tooltip] Downgrade disabled error to a warning #40355

Closed
grantdiamond opened this issue Dec 29, 2023 · 7 comments · Fixed by #44846
Closed

[tooltip] Downgrade disabled error to a warning #40355

grantdiamond opened this issue Dec 29, 2023 · 7 comments · Fixed by #44846
Assignees
Labels
component: tooltip This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature ready to take Help wanted. Guidance available. There is a high chance the change will be accepted waiting for 👍 Waiting for upvotes

Comments

@grantdiamond
Copy link

grantdiamond commented Dec 29, 2023

Summary 💡

I get the following error when I have a disabled button nested in a tooltip:

You are providing a disabled `button` child to the Tooltip component.
A disabled element does not fire events.
Tooltip needs to listen to the child element's events to display the title.

This is the behavior I want - for the tooltip to be disabled while the button is disabled.

Can we downgrade this from an error to a warning? An ideal solution would be to add a disabled prop to the tooltip component that passes down.

Examples 🌈

No response

Motivation 🔦

No response

@grantdiamond grantdiamond added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Dec 29, 2023
@zannager zannager added the component: tooltip This is the name of the generic UI component, not the React module! label Dec 29, 2023
@danilo-leal danilo-leal changed the title Downgrade disabled tooltip error to a warning [Tooltip] Downgrade disabled error to a warning Jan 2, 2024
@siriwatknp siriwatknp added enhancement This is not a bug, nor a new feature and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jan 5, 2024
@siriwatknp
Copy link
Member

Agree, a warning sounds better for this. cc @mui/core

@Nefcanto
Copy link

Also could you please tell us which Tooltip?

We have more than 40 Tooltips in our app and this is what we see:

Screenshot from 2024-10-30 15-24-03

How are we supposed to find out which Tooltip is causing this error/warning?

@DiegoAndai
Copy link
Member

@Nefcanto thanks for reaching out and sorry for the delay.

I'll add the waiting for 👍🏼 label so the community can vote for this new feature. If you want to see this implemented, please add a 👍🏼 reaction to the issue's description. I'll also add the ready to take label in case anyone wants to work on this before the team gets to it. Please reach out if you're interested, I'll gladly guide you.

@DiegoAndai DiegoAndai added waiting for 👍 Waiting for upvotes ready to take Help wanted. Guidance available. There is a high chance the change will be accepted labels Dec 20, 2024
@yash49
Copy link
Contributor

yash49 commented Dec 21, 2024

Hi @DiegoAndai
Can you please tell me what needs to be done here?
Replace console.error with console.warn?

@yash49
Copy link
Contributor

yash49 commented Dec 23, 2024

Hey @DiegoAndai @siriwatknp
I've raised a PR #44846
Can you please review it

Copy link

This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

Note

@grantdiamond How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

@oliviertassinari oliviertassinari changed the title [Tooltip] Downgrade disabled error to a warning [tooltip] Downgrade disabled error to a warning Dec 29, 2024
@oliviertassinari
Copy link
Member

oliviertassinari commented Dec 29, 2024

Under #21979, I guess error -> warn make sense.

An ideal solution would be to add a disabled prop to the tooltip component that passes down.

@grantdiamond You are expected to set <Tooltip title={disabled ? '' : message} in this case. At least, it's the DX of the component that was designed to support your use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: tooltip This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature ready to take Help wanted. Guidance available. There is a high chance the change will be accepted waiting for 👍 Waiting for upvotes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants