File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
packages/runtime-dom/src/components Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -260,11 +260,11 @@ export function resolveTransitionProps(
260
260
// the css will not get the final state (#10677)
261
261
if ( ! el . _enterCancelled ) {
262
262
// force reflow so *-leave-from classes immediately take effect (#2593)
263
- forceReflow ( )
263
+ forceReflow ( el )
264
264
addTransitionClass ( el , leaveActiveClass )
265
265
} else {
266
266
addTransitionClass ( el , leaveActiveClass )
267
- forceReflow ( )
267
+ forceReflow ( el )
268
268
}
269
269
nextFrame ( ( ) => {
270
270
if ( ! el . _isLeaving ) {
@@ -476,6 +476,7 @@ function toMs(s: string): number {
476
476
}
477
477
478
478
// synchronously force layout to put elements into a certain state
479
- export function forceReflow ( ) : number {
480
- return document . body . offsetHeight
479
+ export function forceReflow ( el ?: Node ) : number {
480
+ const targetDocument = el ? el . ownerDocument ! : document
481
+ return targetDocument . body . offsetHeight
481
482
}
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ const TransitionGroupImpl: ComponentOptions = /*@__PURE__*/ decorate({
92
92
const movedChildren = prevChildren . filter ( applyTranslation )
93
93
94
94
// force reflow to put everything in position
95
- forceReflow ( )
95
+ forceReflow ( instance . vnode . el as Node )
96
96
97
97
movedChildren . forEach ( c => {
98
98
const el = c . el as ElementWithTransition
You can’t perform that action at this time.
0 commit comments