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(
260260 // the css will not get the final state (#10677)
261261 if ( ! el . _enterCancelled ) {
262262 // force reflow so *-leave-from classes immediately take effect (#2593)
263- forceReflow ( )
263+ forceReflow ( el )
264264 addTransitionClass ( el , leaveActiveClass )
265265 } else {
266266 addTransitionClass ( el , leaveActiveClass )
267- forceReflow ( )
267+ forceReflow ( el )
268268 }
269269 nextFrame ( ( ) => {
270270 if ( ! el . _isLeaving ) {
@@ -476,6 +476,7 @@ function toMs(s: string): number {
476476}
477477
478478// 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
481482}
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ const TransitionGroupImpl: ComponentOptions = /*@__PURE__*/ decorate({
9292 const movedChildren = prevChildren . filter ( applyTranslation )
9393
9494 // force reflow to put everything in position
95- forceReflow ( )
95+ forceReflow ( instance . vnode . el as Node )
9696
9797 movedChildren . forEach ( c => {
9898 const el = c . el as ElementWithTransition
You can’t perform that action at this time.
0 commit comments