@@ -123,7 +123,7 @@ export function resolveTransitionProps(
123
123
const resolve = ( ) => finishEnter ( el , isAppear , done )
124
124
hook && hook ( el , resolve )
125
125
nextFrame ( ( ) => {
126
- addTransitionClass ( el , isAppear ? appearActiveClass : enterActiveClass )
126
+ enableTransition ( el )
127
127
removeTransitionClass ( el , isAppear ? appearFromClass : enterFromClass )
128
128
addTransitionClass ( el , isAppear ? appearToClass : enterToClass )
129
129
if ( ! ( hook && hook . length > 1 ) ) {
@@ -133,22 +133,40 @@ export function resolveTransitionProps(
133
133
}
134
134
}
135
135
136
+ // see issue #2531, #2593
137
+ let cacheTransition : string
138
+ const disableTransition = ( el : Element ) => {
139
+ const style = ( el as HTMLElement ) . style
140
+ cacheTransition = style . transition
141
+ style . transitionProperty = 'none'
142
+ }
143
+
144
+ const enableTransition = ( el : Element ) => {
145
+ ; ( el as HTMLElement ) . style . transition = cacheTransition
146
+ }
147
+
136
148
return extend ( baseProps , {
137
149
onBeforeEnter ( el ) {
138
150
onBeforeEnter && onBeforeEnter ( el )
151
+ addTransitionClass ( el , enterActiveClass )
139
152
addTransitionClass ( el , enterFromClass )
153
+ disableTransition ( el )
140
154
} ,
141
155
onBeforeAppear ( el ) {
142
156
onBeforeAppear && onBeforeAppear ( el )
157
+ addTransitionClass ( el , appearActiveClass )
143
158
addTransitionClass ( el , appearFromClass )
159
+ disableTransition ( el )
144
160
} ,
145
161
onEnter : makeEnterHook ( false ) ,
146
162
onAppear : makeEnterHook ( true ) ,
147
163
onLeave ( el , done ) {
148
164
const resolve = ( ) => finishLeave ( el , done )
165
+ addTransitionClass ( el , leaveActiveClass )
149
166
addTransitionClass ( el , leaveFromClass )
167
+ disableTransition ( el )
150
168
nextFrame ( ( ) => {
151
- addTransitionClass ( el , leaveActiveClass )
169
+ enableTransition ( el )
152
170
removeTransitionClass ( el , leaveFromClass )
153
171
addTransitionClass ( el , leaveToClass )
154
172
if ( ! ( onLeave && onLeave . length > 1 ) ) {
0 commit comments