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

Unnecessary re-rendering of content in the slot #309

Open
e4se opened this issue Apr 2, 2024 · 3 comments
Open

Unnecessary re-rendering of content in the slot #309

e4se opened this issue Apr 2, 2024 · 3 comments

Comments

@e4se
Copy link

e4se commented Apr 2, 2024

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
Copy link
Owner

@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
Copy link
Author

e4se commented Apr 3, 2024

@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
Copy link
Author

e4se commented Apr 16, 2024

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

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