-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
$refs in slots disappear when wrapping Teleport #2283
Comments
doesn't happen when using actual https://codesandbox.io/s/vue-ref-bug-issue-2283-jrdvs I assume it's caused in part by the slot optimizations - when App.vue re-renders, $refs is cleared: and all refs are updated in post-render Effects Queued up during the patch() phase by calling setRef(): But as the slot content sent to So the setRefs() method is called only once, for ref1 which is in the Consequnetly, if we make the slot content depending on Not sure this bug is limited to teleport. Also, not surte that the clearing of refs actually makes sense? When a vnode is unmounted, |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I just encountered this too. It seems to happen for every |
Version
3.0.0
Reproduction link
https://codesandbox.io/s/vue-ref-bug-dhsol?file=/src/App.vue
Steps to reproduce
follow the link
What is expected?
$refs.ref2
&$refs.ref3
should be bind when focus the input.What is actually happening?
they are undefined.
The text was updated successfully, but these errors were encountered: