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

VNode.elm missing for nested slots after component update #5427

Closed
jkzing opened this issue Apr 13, 2017 · 2 comments
Closed

VNode.elm missing for nested slots after component update #5427

jkzing opened this issue Apr 13, 2017 · 2 comments

Comments

@jkzing
Copy link
Member

jkzing commented Apr 13, 2017

Version

2.2.6

Reproduction link

https://jsfiddle.net/jingkaizhao/f11tpysz/5/

Steps to reproduce

  1. open and run fiddle
  2. open chrome devtool
  3. click 'update' button
  4. see result in console

What is expected?

In updated hook, vnode inside slots children (this.$slots.default) should have a reference to its DOM element on property vnode.elm

What is actually happening?

vnode.elm is undefined


Did some investigation on it.
It just happened on nested component, (<slot> as children for another component). And it only happened after patching, it means in the initial stage (mounted hook), the vnode has correct reference to its DOM node, but after update (updated hook), the elm reference is missing.

@jkzing jkzing changed the title VNode.elm missing in nested slots VNode.elm missing for nested slots after component update Apr 13, 2017
@HerringtonDarkholme
Copy link
Member

It seems slot vnode will be copied across different components. So the vnode in nested copmonent is not updated. Still needs deeper investigation...

@yyx990803
Copy link
Member

This is somewhat expected behavior because slot nodes are shallow-cloned during render, so when nested passes the slot nodes down to block, block clones the slot nodes and then patches them (adding .elm in the process), however, the slot nodes in nested remain non-patched.

This is a wontfix because you should not be relying on vnode.elm in your render functions. This is not part of intended usage for vnodes.

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

3 participants