Skip to content

Manual closing of vue-tippy #307

Open
@eposwiatny

Description

``Hello everyone!

I have one question related to VueTippy because I don't really know if I'm doing something wrong or it's not supported by VueTippy.

I have a button as a target. Once I click on it, it open tippy / popover with 2 others buttons inside (Kind of dropdown). Once I click on button inside tooltip, I would like to close tippy directly after.

From what I know, VueTIppy support hide() but sems it doesn't working correctly when I click on element inside tippy

My code:

Template

<tippy ref="tooltip" :interactive="true" trigger="click"> <slot name="target" /> <template #content> <div> <slot name="content" /> </div> </template> </tippy>

Script

`<script lang="ts" setup>
import { Tippy } from "vue-tippy";
import { defineProps, ref } from "vue";

const tooltip = ref<InstanceType>();
const hide = () => {
tooltip.value?.hide();
};

defineExpose({
hide,
});`

Edit:

When I add button directly inside tooltip file, It's working but when I want to close is from another file trought defineExpose isn't working

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions