Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Commit 398ecd9

Browse files
author
Gabriel Schulhof
committed
[popup] Only rapid-open the popup if it is open -- Fixes #5157
1 parent b793599 commit 398ecd9

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

js/widgets/popup.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,19 @@ define( [ "jquery",
112112
},
113113

114114
_resizeTimeout: function() {
115-
if ( !this._maybeRefreshTimeout() ) {
116-
// effectively rapid-open the popup while leaving the screen intact
117-
this._trigger( "beforeposition" );
118-
this._ui.container
119-
.removeClass( "ui-selectmenu-hidden" )
120-
.offset( this._placementCoords( this._desiredCoords( undefined, undefined, "window" ) ) );
121-
122-
this._resizeScreen();
115+
if ( this._isOpen ) {
116+
if ( !this._maybeRefreshTimeout() ) {
117+
// effectively rapid-open the popup while leaving the screen intact
118+
this._trigger( "beforeposition" );
119+
this._ui.container
120+
.removeClass( "ui-selectmenu-hidden" )
121+
.offset( this._placementCoords( this._desiredCoords( undefined, undefined, "window" ) ) );
122+
123+
this._resizeScreen();
124+
this._resizeData = null;
125+
this._orientationchangeInProgress = false;
126+
}
127+
} else {
123128
this._resizeData = null;
124129
this._orientationchangeInProgress = false;
125130
}
@@ -132,8 +137,7 @@ define( [ "jquery",
132137
},
133138

134139
_handleWindowOrientationchange: function( e ) {
135-
136-
if ( !this._orientationchangeInProgress ) {
140+
if ( !this._orientationchangeInProgress && this._isOpen ) {
137141
// effectively rapid-close the popup while leaving the screen intact
138142
this._ui.container
139143
.addClass( "ui-selectmenu-hidden" )

0 commit comments

Comments
 (0)