Skip to content

fix(transition-group): handle non-visible list items, fix #8516 #11128

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

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

yannisgu
Copy link

@yannisgu yannisgu commented Feb 19, 2020

Handle the case, when a component inside a transition-group doesn't yield any HTML, e.g. when there is a v-if on the root-element.

Before this fix, transition-group would fail with the errror c$1.elm.getBoundingClientRect is not a function, when moving items, if there was such an item.

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

Other information:

@yannisgu yannisgu changed the title WIP: fix(transition-group): handle non-visible list items fix(transition-group): handle non-visible list items Feb 19, 2020
Handle the case, when a component inside a transition-group
doens't yield any HTML, e.g. when there is a `v-if` on the root-element. Before this fix, transition-group would fail with the errror
`c$1.elm.getBoundingClientRect is not a function`.
@yannisgu yannisgu force-pushed the fix/transition-group branch from fac71bf to bc2dc91 Compare April 16, 2020 07:32
@yannisgu yannisgu changed the title fix(transition-group): handle non-visible list items fix(transition-group): handle non-visible list items, fix #8516 Apr 16, 2020
@DabeDotCom
Copy link

FWIW, I just ran into a similar problem (even under 2.6.12) and fixed worked around it by adding:

--- a/transition-group.js	2021-03-04 14:24:20.000000000 -0500
+++ b/transition-group.js	2021-03-04 14:25:18.000000000 -0500
@@ -79,6 +79,7 @@ export default {
       const removed: Array<VNode> = []
       for (let i = 0; i < prevChildren.length; i++) {
         const c: VNode = prevChildren[i]
+        if (!c) continue
         c.data.transition = transitionData
         c.data.pos = getBoundingClientRect(c)
         if (map[c.key]) {

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

Successfully merging this pull request may close these issues.

2 participants