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

Tooltip: showDelay still triggers Tooltip when original element is removed #4029

Closed
Benoxi opened this issue Jun 6, 2023 · 1 comment
Closed
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@Benoxi
Copy link

Benoxi commented Jun 6, 2023

Describe the bug

Description:

When using the Tooltip component with showDelay and we destroy the original trigger element (before the showDelay time runs out), the Tooltip still appears, even though the trigger element is not there anymore.

Example code:

<template>
    <div>
        <Button
            v-if="isShown"
            label="hide this button"
            @click="isShown = false"
            v-tooltip.bottom="{ value: 'This is a tooltip', showDelay: 2000 }"
        />
    </div>
</template>

<script setup>
import { ref } from 'vue';

const isShown = ref(true);
</script>

Reproducer

https://codesandbox.io/p/sandbox/eager-sea-qpwszh?file=%2Fsrc%2FApp.vue%3A8%2C8

PrimeVue version

3.29.2

Vue version

3.x

Language

ALL

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior

Steps to reproduce:

  • Create a Button that can be removed (removed from render)
  • Add a Tooltip (v-tooltip.bottom to see the issue better) with a showDelay of 2000 (enough to close the parent component before the Tooltip would show) to the element/component
  • Close (remove) the component before the showDelay runs out

Expected behavior:

The Button is removed and the Tooltip is not shown

Actual behavior:

The Tooltip still appears in the top left corner, coord (0,0)

Suggested fix:

Before showing the Tooltip, check again if the trigger element exists on the page

Expected behavior

The Button is removed and the Tooltip is not shown

@Benoxi Benoxi added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jun 6, 2023
@tugcekucukoglu tugcekucukoglu added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Jun 6, 2023
@tugcekucukoglu tugcekucukoglu self-assigned this Jun 6, 2023
@hamidovz
Copy link
Contributor

hi ! i fixed this bug. can i send a PR ? @tugcekucukoglu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

3 participants