Skip to content

DropdownMenuContent as-child > ref element is not updated when closed #905

Answered by zernonia
linusang asked this question in Q&A
Discussion options

You must be logged in to vote

Hmm.. seems abit weird that passing string to ref doesn't update the it when unmounted in this case, but using function does. Might be something with Vue, for the mean time you can use this as alternative

<div
  style="background-color: yellowgreen"
  :ref="(el) => (contentEl = el)"
>

https://stackblitz.com/edit/vitejs-vite-dueuhu?file=src%2FApp.vue

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by zernonia
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
bug Something isn't working
2 participants
Converted from issue

This discussion was converted from issue #694 on May 10, 2024 10:10.