Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manual closing of vue-tippy #307

Open
eposwiatny opened this issue Feb 28, 2024 · 1 comment
Open

Manual closing of vue-tippy #307

eposwiatny opened this issue Feb 28, 2024 · 1 comment

Comments

@eposwiatny
Copy link

eposwiatny commented Feb 28, 2024

``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

@KABBOUCHI
Copy link
Owner

plz can u re-create the issue here? https://vue.new

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants