primefaces / primevue

Next Generation Vue UI Component Library
https://primevue.org
MIT License
8.8k stars 1.09k forks source link

ToolTips not reactive #4082

Open v0dka-Developments opened 1 year ago

v0dka-Developments commented 1 year ago

Describe the bug

The tooltip does not update when hovered, if you unhover and then hover the element is then updated

Reproducer

https://codesandbox.io/s/heuristic-cori-mpyyx8?file=/src/App.vue

PrimeVue version

latest

Vue version

3.x

Language

TypeScript

Build / Runtime

Vue CLI App

Browser(s)

No response

Steps to reproduce the behavior

Hover over the spinning circle, the tooltip does not update untill unhovered than re-hovered

Expected behavior

tooltip should update

ghost commented 1 year ago

Well, I just arrived here searching about the exact problem.

From what I checked the source code (https://github.com/primefaces/primevue/blob/master/components/lib/tooltip/Tooltip.js#L151), there is nothing defined to update the text if it changes. It needs to be destroyed and created again to received the update value, which is bummer.

When you do a mouse over / out. It creates / destroy component. So if you overs back again, it gets the updated text, like you said.

Ideally, the method updated method should be refactored to force component recreation. https://github.com/primefaces/primevue/blob/master/components/lib/tooltip/Tooltip.js#L407C5-L445

ghost commented 9 months ago

@tugcekucukoglu Is this a issue to be addressed or has the team already addressed this issue?

Basically, I would like to use reactive/dynamic text in the tooltip. We are using version 3.26.1 and this is not possible.