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

Expose disabled prop for Tooltip, so we can conditionally render it #13052

Open
muchisx opened this issue Jan 16, 2025 · 0 comments
Open

Expose disabled prop for Tooltip, so we can conditionally render it #13052

muchisx opened this issue Jan 16, 2025 · 0 comments

Comments

@muchisx
Copy link

muchisx commented Jan 16, 2025

Summary

There's two ways maybe I see this going

  1. Via the content (prefered)
    If content is null then it will skip rendering the Tooltip and will only render the children.

  2. Via new prop disabled
    If disabled is true then it will skip rendering the Tooltip and will only render the children

Rationale

Sometimes a tooltip is conditional to the state of the element is wrapping, or something else in the page.

A lot of times we want to add tooltips to disabled buttons to explain why they are disabled.

This becomes cumbersome as we need to do a ConditionalWrapper component that handles the rendering of the tooltip.

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

No branches or pull requests

1 participant