mirror of https://github.com/vuejs/core.git
close #13849
This commit is contained in:
parent
d44a5a98c8
commit
1be5ddfe87
|
@ -260,11 +260,11 @@ export function resolveTransitionProps(
|
||||||
// the css will not get the final state (#10677)
|
// the css will not get the final state (#10677)
|
||||||
if (!el._enterCancelled) {
|
if (!el._enterCancelled) {
|
||||||
// force reflow so *-leave-from classes immediately take effect (#2593)
|
// force reflow so *-leave-from classes immediately take effect (#2593)
|
||||||
forceReflow()
|
forceReflow(el)
|
||||||
addTransitionClass(el, leaveActiveClass)
|
addTransitionClass(el, leaveActiveClass)
|
||||||
} else {
|
} else {
|
||||||
addTransitionClass(el, leaveActiveClass)
|
addTransitionClass(el, leaveActiveClass)
|
||||||
forceReflow()
|
forceReflow(el)
|
||||||
}
|
}
|
||||||
nextFrame(() => {
|
nextFrame(() => {
|
||||||
if (!el._isLeaving) {
|
if (!el._isLeaving) {
|
||||||
|
@ -476,6 +476,7 @@ function toMs(s: string): number {
|
||||||
}
|
}
|
||||||
|
|
||||||
// synchronously force layout to put elements into a certain state
|
// synchronously force layout to put elements into a certain state
|
||||||
export function forceReflow(): number {
|
export function forceReflow(el?: Node): number {
|
||||||
return document.body.offsetHeight
|
const targetDocument = el ? el.ownerDocument! : document
|
||||||
|
return targetDocument.body.offsetHeight
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,7 +92,7 @@ const TransitionGroupImpl: ComponentOptions = /*@__PURE__*/ decorate({
|
||||||
const movedChildren = prevChildren.filter(applyTranslation)
|
const movedChildren = prevChildren.filter(applyTranslation)
|
||||||
|
|
||||||
// force reflow to put everything in position
|
// force reflow to put everything in position
|
||||||
forceReflow()
|
forceReflow(instance.vnode.el as Node)
|
||||||
|
|
||||||
movedChildren.forEach(c => {
|
movedChildren.forEach(c => {
|
||||||
const el = c.el as ElementWithTransition
|
const el = c.el as ElementWithTransition
|
||||||
|
|
Loading…
Reference in New Issue