@@ -565,8 +565,9 @@ export default {
565
565
relatedTarget : null
566
566
} )
567
567
this . emitEvent ( showEvt )
568
+ // Don't show if canceled
568
569
if ( showEvt . defaultPrevented || this . is_visible ) {
569
- // Don't show if canceled
570
+ this . is_opening = false
570
571
return
571
572
}
572
573
if ( ! this . noStacking ) {
@@ -613,6 +614,7 @@ export default {
613
614
this . emitEvent ( hideEvt )
614
615
// Hide if not canceled
615
616
if ( hideEvt . defaultPrevented || ! this . is_visible ) {
617
+ this . is_closing = false
616
618
return
617
619
}
618
620
// stop observing for content changes
@@ -862,12 +864,13 @@ export default {
862
864
modal . style . paddingRight = ''
863
865
}
864
866
} ,
865
- checkScrollbar ( ) {
867
+ checkScrollbar ( ) /* istanbul ignore next: getBCR can't be tested in JSDOM */ {
866
868
const { left, right, height } = getBCR ( document . body )
867
869
// Extra check for body.height needed for stacked modals
868
870
this . isBodyOverflowing = ( left + right ) < window . innerWidth || height > window . innerHeight
869
871
} ,
870
872
setScrollbar ( ) {
873
+ /* istanbul ignore if: get Computed Style can't be tested in JSDOM */
871
874
if ( this . isBodyOverflowing ) {
872
875
// Note: DOMNode.style.paddingRight returns the actual value or '' if not set
873
876
// while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set
@@ -959,6 +962,8 @@ export default {
959
962
this . _observer . disconnect ( )
960
963
this . _observer = null
961
964
}
965
+ // Ensure our root "once" listener is gone
966
+ this . $root . $off ( 'bv::modal::hidden' , this . doShow )
962
967
this . setEnforceFocus ( false )
963
968
this . setResizeEvent ( false )
964
969
if ( this . is_visible ) {
0 commit comments