helipopper icon indicating copy to clipboard operation
helipopper copied to clipboard

Disable all tippy programmatically

Open davidecampello opened this issue 2 years ago • 6 comments
trafficstars

I'm submitting a...


[x] Support request

Hi, is it possible to disable all the configured tooltips programmatically? I have an application wher I don't want to show any tippy based on some condition decided by a observable stream.

The solution for now is to calculate the required conditions (based on platform, screen size and custom user setting) and add or remove a class to the entire body that hide all .tippy-box child elements, but is there any other way supported by the library?

Thanks

davidecampello avatar Jan 03 '23 14:01 davidecampello

Do you have multiple tooltips that are opened at the same time?

NetanelBasal avatar Jan 04 '23 06:01 NetanelBasal

Hi! No, I don't have..

davidecampello avatar Jan 04 '23 09:01 davidecampello

So what's the use case?

NetanelBasal avatar Jan 04 '23 09:01 NetanelBasal

I want have tooltips only when some conditions are true. For example screen size is larger than x pixels, to target only computers and tablets and not smartphones (in our app the condition is more complex). Instead of using isEnabled input property for each place where I use tippy directive, I wonder if exist a global way to disable all tooltips.

davidecampello avatar Jan 06 '23 21:01 davidecampello

Currently, no. You're welcome to create a PR

NetanelBasal avatar Jan 07 '23 15:01 NetanelBasal

I want have tooltips only when some conditions are true

you can use disable and enable tooltip with run time change detect and sending run time conditions

Tweniee avatar Dec 05 '23 09:12 Tweniee