KABBOUCHI / vue-tippy

VueJS Tooltip powered by Tippy.js
https://vue-tippy.netlify.app
MIT License
726 stars 87 forks source link

Is state shared among instances? #226

Closed tonychuuy closed 2 years ago

tonychuuy commented 2 years ago

I'm using the state slot property from the default slot, and I'm just realized it is shared among different tippy instance.

Example: https://codesandbox.io/s/vue-tippy-shared-state-ylmyb?file=/src/App.vue

<tippy placement="right">
        <template #default="{ state }">
          <button type="button">
            Trigger <span v-show="state.isVisible">(visible)</span>
          </button>
        </template>
        <template #content> Working tooltip </template>
</tippy>

<tippy placement="right">
        <button type="button">Trigger</button>
        <template #content> Working tooltip </template>
</tippy>

When I trigger the second tippy the state from the first one changes. Is this the intended behavior?

KABBOUCHI commented 2 years ago

I released a quick fix plz can u try it? v6.0.0-alpha.43

tonychuuy commented 2 years ago

Nice, now the state is independent from different instances. Thanks.