Skip to content

[FEAT REQ] Hide tooltip using data-attributes on anchor element #1003

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

Closed
jurahalas opened this issue Apr 6, 2023 · 5 comments · Fixed by #1023
Closed

[FEAT REQ] Hide tooltip using data-attributes on anchor element #1003

jurahalas opened this issue Apr 6, 2023 · 5 comments · Fixed by #1023

Comments

@jurahalas
Copy link

Imagine I have some state in my components and this state control whether or not display tooltip. In the previous version there was props data-tip-disable

@jurahalas
Copy link
Author

I can set empty string for data-tooltip-content={hide ? '' : name} but is there better way

@gabrieljablonski
Copy link
Member

I can set empty string for data-tooltip-content={hide ? '' : name} but is there better way

As of right now, this is probably the cleanest way to do it. I'll edit the issue and leave this open as a feature request.

@gabrieljablonski gabrieljablonski changed the title How can I hide tooltip using data-attributes on anchor element? [FEAT REQ] Hide tooltip using data-attributes on anchor element Apr 6, 2023
@github-actions
Copy link

github-actions bot commented May 7, 2023

This issue is stale because it has not seen activity in 30 days. Remove the stale label or comment within 14 days, or it will be closed.

@github-actions github-actions bot added the Stale This has not seen activity in quite some time label May 7, 2023
@gabrieljablonski gabrieljablonski removed the Stale This has not seen activity in quite some time label May 7, 2023
@neochief
Copy link

I would also like to have this implemented. The content hack doesn't really work if you render the content inside the Tooltip component.

@gabrieljablonski
Copy link
Member

gabrieljablonski commented May 10, 2023

@neochief We're planning on having a look at this and the other issues soon. Until then, for your use case, would this work? https://stackblitz.com/edit/react-ts-k3miko?file=App.tsx

If the children passed to the tooltip component is falsy, the tooltip also doesn't render.

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

Successfully merging a pull request may close this issue.

3 participants