-
-
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
TransitionGroup getBoundingClientRect is not a function #6745
Comments
There are two issues at play here:
|
Another use case arises when using custom components within a |
` Post list
Why this not working? |
@locki13freja What does the template of |
I fixed this error by removing a comment in a child component just above the |
I fixed this error by changing the place of the v-if The transition worked when 'isOpen' became true. The error occurred when 'isOpen' became false. After changing the place of the v-if from:
to so:
It all worked. Seems logical: It was trying to transition an emtpy/non-existing 'element'. @yurirnascimento [v-if="item.visible"] and @locki13freja: could that have been the problem in your case too? |
In my case, I solved this by changing from: <TransitionGroup name="list" tag="div">
<CustomComponent v-for="item in items" :key="item.id" :componentProp="prop" />
</CustomComponent> To: <TransitionGroup name="list" tag="ul">
<li v-for="item in items" :key="item.id">
<CustomComponent :componentProp="prop" />
</li>
</TransitionGroup> |
It seems I am no longer encountering this issue in Vue 3.3.4 |
@Tobiaqs thank you, I had this bug because I had multiple root notes, but one of them was just a comment and I didn't thought that it may cause the issue, but it did |
It seems I'm still encountering this issue, even in Vue 3.4.x This is my workaround (works with Vite). It disables transitions in dev. In prod everything works... // FixedTransitionGroup.vue
//
// Usage:
// <FixedTransitionGroup
// enter-active-class="transform ease-out duration-300 transition"
// enter-from-class="translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2"
// enter-to-class="translate-y-0 opacity-100 sm:translate-x-0"
// leave-active-class="transition ease-in duration-100"
// leave-from-class="opacity-100"
// leave-to-class="opacity-0">
// <!-- your content -->
// </FixedTransitionGroup>
<template>
<TransitionGroup v-if="PROD" v-bind="$attrs">
<slot></slot>
</TransitionGroup>
<template v-else>
<slot></slot>
</template>
</template>
<script lang="ts" setup>
defineOptions({
inheritAttrs: false,
})
const PROD = import.meta.env.PROD
</script> |
Closing as it had been fixed via #9421 |
Vue version
3.2.31
Link to minimal reproduction
https://stackblitz.com/edit/vitejs-vite-srxkag?file=src%2Fcomponents%2FHelloWorld.vue
Steps to reproduce
In parent component I have
And if child component init with html comment
I get the "TypeError: child.el.getBoundingClientRect is not a function"
Work if I remove the HTML comment from first line in template.
What is expected?
Execute the transition correctly, with or without comment on the child element
What is actually happening?
TypeError: child.el.getBoundingClientRect is not a function
System Info
No response
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: