-
-
Notifications
You must be signed in to change notification settings - Fork 187
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 are not available on $nextTick when using portal #23
Comments
I'll have a look at this, but I'm not sure I can find a proper solution. The reason for this beahviour is that I postpone the rendering update of any This timeout is what produces your behaviour. I'll try and find a solution, but can't promise anything yet. |
Hm, so I switched the mechanism for my async scheduler to use I have ideas about how to make the wormhole updates happen synchronously, but that might technically be a breaking change, but only a little one. Anyways and I won't attempt to make this change this before #26 is done, so this will move to the 1.1 Milestone for now. |
* develop: (27 commits) 1.0.0-beta.4 chores changed build script to work around cross-env improved examples, added router to split things up nicely fix example index.js for production run new test build bumping dependencies caused troubles with dependency svgo fix dockute dependency and nom script add $refs test to the examples add section about $refs caveat from #23 to docs chores clean up npm scripts, include test run in build script remove unnecessary folder add „Caveats“ page to docs add test for abstract component option Document SSR limitations when using „targetEl“ make „to“ optional when targetEl is provided (fix #30) add reference to parent component (fix #34) (fix#35) (+1 squashed commit) Squashed commits: [770211d] enhance `targetEl` example with test component to verify that it shows up in devtools correctly. switch to nextTick instead of timeout in hopes of making refs work ...
I will close this in favor of a real feature issue #39 |
Hey @LinusBorg I may be doing something wrong but I dont think this was ever solved with #39: https://jsfiddle.net/ke9b8j4e/3/ (i inlined portal-vue so youll need to scroll to the bottom of the script section to see the app code) I found that if I use a second $nextTick then the $ref is populated as expected |
Please open a new issue |
Hi.
This is not very standard issue, but it's definitely caused by portal-vue. Let's see the code:
If I click a button somewhere and trigger my
handler
, I get an error, becausethis.$refs.div
is undefined. The element inside the portal isn't rendered yet at this point. But when I do the same without the portal, it works as intended. So far I couldn't come up with an adequate solution. Any ideas?The text was updated successfully, but these errors were encountered: