File tree 1 file changed +15
-1
lines changed
1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -416,10 +416,24 @@ class Modal {
416
416
return
417
417
}
418
418
419
+ const isModalOverflowing =
420
+ this . _element . scrollHeight > document . documentElement . clientHeight
421
+
422
+ if ( ! isModalOverflowing ) {
423
+ this . _element . style . overflowY = 'hidden'
424
+ }
425
+
419
426
this . _element . classList . add ( ClassName . STATIC )
420
- const modalTransitionDuration = getTransitionDurationFromElement ( this . _element )
427
+ const modalTransitionDuration = getTransitionDurationFromElement ( this . _dialog )
428
+ EventHandler . off ( this . _element , TRANSITION_END )
421
429
EventHandler . one ( this . _element , TRANSITION_END , ( ) => {
422
430
this . _element . classList . remove ( ClassName . STATIC )
431
+ if ( ! isModalOverflowing ) {
432
+ EventHandler . one ( this . _element , TRANSITION_END , ( ) => {
433
+ this . _element . style . overflowY = ''
434
+ } )
435
+ emulateTransitionEnd ( this . _element , modalTransitionDuration )
436
+ }
423
437
} )
424
438
emulateTransitionEnd ( this . _element , modalTransitionDuration )
425
439
this . _element . focus ( )
You can’t perform that action at this time.
0 commit comments