I want to disable tippy when on mobile. For this I have the following script. I use it like explained in the documentation of tippy:
const mytippies = tippy('[data-tippy-content]', {
plugins: [hideOnEsc],
});
mytippies.disable();
Doing this I get error Uncaught TypeError: (0 , o.default)(...).disable is not a function
what am I doing wrong?
The problem here is that the instance mytippies
is an array of instances. The disable
method only works on a single instance. So using a for loop I can disable Tippy for all my instances:
for (let i = 0; i < mytippies.length; i++) {
mytippies[i].disable();
}