@@ -94,7 +94,6 @@ class Popup extends Component<PopupProps, PopupState> {
94
94
targetHeight : undefined ,
95
95
96
96
status : null ,
97
- prevVisible : null ,
98
97
alignClassName : null ,
99
98
} ;
100
99
@@ -120,7 +119,8 @@ class Popup extends Component<PopupProps, PopupState> {
120
119
} else if ( visible !== prevVisible ) {
121
120
if (
122
121
visible ||
123
- ( supportMotion ( mergedMotion ) && [ 'motion' , 'AfterMotion' , 'stable' ] . includes ( status ) )
122
+ ( supportMotion ( mergedMotion ) &&
123
+ [ 'motion' , 'AfterMotion' , 'stable' ] . includes ( status ) )
124
124
) {
125
125
newState . status = null ;
126
126
} else {
@@ -169,7 +169,13 @@ class Popup extends Component<PopupProps, PopupState> {
169
169
170
170
default : {
171
171
// Go to next status
172
- const queue : PopupStatus [ ] = [ 'measure' , 'align' , null , 'beforeMotion' , 'motion' ] ;
172
+ const queue : PopupStatus [ ] = [
173
+ 'measure' ,
174
+ 'align' ,
175
+ null ,
176
+ 'beforeMotion' ,
177
+ 'motion' ,
178
+ ] ;
173
179
const index = queue . indexOf ( status ) ;
174
180
const nextStatus = queue [ index + 1 ] ;
175
181
if ( index !== - 1 && nextStatus ) {
@@ -291,16 +297,21 @@ class Popup extends Component<PopupProps, PopupState> {
291
297
292
298
const mergedStyle : React . CSSProperties = {
293
299
...sizeStyle ,
294
- ...style ,
295
300
...this . getZIndexStyle ( ) ,
301
+ ...style ,
296
302
opacity : status === 'stable' || ! visible ? undefined : 0 ,
297
303
} ;
298
304
299
305
// ================= Motions =================
300
306
const mergedMotion = this . getMotion ( ) ;
301
307
let mergedMotionVisible = visible ;
302
308
303
- if ( visible && status !== 'beforeMotion' && status !== 'motion' && status !== 'stable' ) {
309
+ if (
310
+ visible &&
311
+ status !== 'beforeMotion' &&
312
+ status !== 'motion' &&
313
+ status !== 'stable'
314
+ ) {
304
315
mergedMotion . motionAppear = false ;
305
316
mergedMotion . motionEnter = false ;
306
317
mergedMotion . motionLeave = false ;
@@ -312,7 +323,8 @@ class Popup extends Component<PopupProps, PopupState> {
312
323
313
324
// ================== Align ==================
314
325
const mergedAlignDisabled =
315
- ! visible || ( status !== 'align' && status !== 'aligned' && status !== 'stable' ) ;
326
+ ! visible ||
327
+ ( status !== 'align' && status !== 'aligned' && status !== 'stable' ) ;
316
328
317
329
// ================== Popup ==================
318
330
let mergedPopupVisible = true ;
@@ -367,7 +379,14 @@ class Popup extends Component<PopupProps, PopupState> {
367
379
} ;
368
380
369
381
renderMaskElement = ( ) => {
370
- const { mask, maskMotion, maskTransitionName, maskAnimation, prefixCls, visible } = this . props ;
382
+ const {
383
+ mask,
384
+ maskMotion,
385
+ maskTransitionName,
386
+ maskAnimation,
387
+ prefixCls,
388
+ visible,
389
+ } = this . props ;
371
390
372
391
if ( ! mask ) {
373
392
return null ;
0 commit comments