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

[Bug]: ref not working properly in custom-wrapped Tooltip with asChild prop #1580

Open
L33Z22L11 opened this issue Jan 26, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@L33Z22L11
Copy link

Environment

Developement/Production OS: Windows 11 26100.2894
Node version: 23.6.0
Package manager: [email protected]
Radix Vue version: 1.9.12
Vue version: 3.5.13
Nuxt version: N/A
Nuxt mode: N/A
Nuxt target: N/A
CSS framework: N/A
Client OS: Windows 11 26100.2894
Browser: Microsoft Edge 132.0.2957.115

Link to minimal reproduction

https://github.com/L33Z22L11/radix-vue-multiref-reprod

Steps to reproduce

  • Clone the repository, install dependencies, and run the project
  • Open the app and inspect the console.

Describe the bug

Only the first Tooltip instance has a valid ref. All other instances return null.

Expected behavior

Each ref should point to the corresponding Tooltip element for every instance of the wrapped component.

Context & Screenshots (if applicable)

Image

@L33Z22L11 L33Z22L11 added the bug Something isn't working label Jan 26, 2025
@L33Z22L11 L33Z22L11 changed the title [Bug]: ref not working properly in custom-wrapped Tooltip [Bug]: ref not working properly in custom-wrapped Tooltip with asChild prop Jan 26, 2025
@zernonia
Copy link
Member

Thanks for reporting the issue @L33Z22L11 ! Attaching the ref to the child of asChild component seems to have this issue.
For now you may attach ref to the parent component, and access the child via $el

https://stackblitz.com/edit/github-wjltu9ee?file=src%2Fcomponents%2FMyTip.vue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants