-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
transition-group containing component with multiple root nodes throws error when transitioning (child.el.getBoundingClientRect is not a function) #4621
Comments
|
I think this issue was closed incorrectly: my example doesn't involve a |
Updated the comment to be clearer, the children should be direct to transition-group or use the transition-group inside |
Are you saying a |
…d text nodes (vuejs#9421) close vuejs#4621 close vuejs#4622 close vuejs#5153 close vuejs#5168 close vuejs#7898 close vuejs#9067
Version
3.2.12
Reproduction link
sfc.vuejs.org/
Steps to reproduce
What is expected?
The transition toggles without warnings or errors.
What is actually happening?
Extraneous non-props attributes (class) were passed to component but could not be automatically inherited because component renders fragment or text root nodes
.Component inside <Transition> renders non-element root node that cannot be animated
.child.el.getBoundingClientRect is not a function
.This only happens if one of the things being toggled inside a
<transition-group>
is a component with multiple root elements. Somehow, this results in the TransitionGroup code trying to process a text node (namely, the whitespace node at the beginning of the transition-group div, before the first child element) as part of the transitioned nodes. This is why it complains about the component rendering "fragment or text root nodes", then about a "non-element root node" (the text node), and why it crashes (it tries to call.getBoundingClientRect()
on this text node).The real-world case where I ran into this bug used a wrapped transition group (
<transition-group tag="div">
). Addingtag="div"
makes the first warning (the one on load about extraneous non-props attributes) go away, but doesn't fix the second warning or the error.The text was updated successfully, but these errors were encountered: