I have two tooltips, one is on an outer element, the other on the inner element like this:
How do I remove the outer tooltip when the inner tooltip is showing?
The code is pretty standard, but keep in mind, sometimes v-tooltip places tooltips like a modal - on the body level, so the tooltips might not actually be nested.
<div id="app">
<div v-tooltip="'Outer Tooltip'">
Outer Area
<div v-tooltip="'Inner Tooltip'">
okokok
</div>
</div>
</div>
Here's what I've tried:
On the Outer Tooltip I put a class like this:
v=tooltip="{content:'Outer Tooltip', classes:['killOnOtherOpen']}"
And then on the inner tooltip:
v=tooltip="getTextAndDoStuff()"
...
getTextAndDoStuff(){
$('.killOnOtherOpen').close();
return "Inner Tooltip";
}
But I get an Error:
Error in render: "TypeError: $(...).close is not a function"
I've tried it like so: .close;
- like close is not a function - but nothing happens, not even an error.
I'm looking for a more elegant or standard way to do this. Adding a class and a method to each nested tooltip set will take a while.