KABBOUCHI / vue-tippy

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

Unnecessary re-rendering of content in the slot #309

Open e4se opened 6 months ago

e4se commented 6 months ago

I've created an example to demonstrate the issue: CodeSandbox Example.

The issue arises when I open the dropdown and attempt to focus on the select element, but it doesn't happen. This issue occurs because the focus event triggers a change in the hideOnClick property of vue-tippy, causing vue-tippy to re-render all content within the slot. Dynamically changing hideOnClick is useful for creating a custom select that appears on top of a tooltip, where clicking an item in the select closes the dropdown. We implemented a workaround where hideOnClick is set to false when the custom select inside the dropdown is open. This solution worked perfectly with Vue 2 and the previous version of vue-tippy, but after migrating to Vue 3 and updating vue-tippy to the latest version, it no longer works.

KABBOUCHI commented 6 months ago

@e4se for now, u can try managing focus manually? https://codesandbox.io/p/devbox/blissful-butterfly-5fqtfl?file=%2Fsrc%2FApp.vue%3A14%2C3

will look into the issue this weekend

e4se commented 6 months ago

@e4se for now, u can try managing focus manually? https://codesandbox.io/p/devbox/blissful-butterfly-5fqtfl?file=%2Fsrc%2FApp.vue%3A14%2C3

In our scenario, we have numerous fields within a tooltip, including select and datepicker components, which need to control the hideOnClick property of the parent tooltip.

image

will look into the issue this weekend

Thx so much!

e4se commented 5 months ago

@KABBOUCHI Hi, have you had a chance to look into the issue?