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

Commit 356f5a4

Browse files
author
Gabriel Schulhof
committed
[popup] Only rapid-open the popup if it is open -- Fixes #5157
1 parent 809cd55 commit 356f5a4

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

js/widgets/popup.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,19 @@ define( [ "jquery",
109109
},
110110

111111
_resizeTimeout: function() {
112-
if ( !this._maybeRefreshTimeout() ) {
113-
// effectively rapid-open the popup while leaving the screen intact
114-
this._trigger( "beforeposition" );
115-
this._ui.container
116-
.removeClass( "ui-selectmenu-hidden" )
117-
.offset( this._placementCoords( this._desiredCoords( undefined, undefined, "window" ) ) );
112+
if ( this._isOpen ) {
113+
if ( !this._maybeRefreshTimeout() ) {
114+
// effectively rapid-open the popup while leaving the screen intact
115+
this._trigger( "beforeposition" );
116+
this._ui.container
117+
.removeClass( "ui-selectmenu-hidden" )
118+
.offset( this._placementCoords( this._desiredCoords( undefined, undefined, "window" ) ) );
118119

119-
this._resizeScreen();
120+
this._resizeScreen();
121+
this._resizeData = null;
122+
this._orientationchangeInProgress = false;
123+
}
124+
} else {
120125
this._resizeData = null;
121126
this._orientationchangeInProgress = false;
122127
}
@@ -129,8 +134,7 @@ define( [ "jquery",
129134
},
130135

131136
_handleWindowOrientationchange: function( e ) {
132-
133-
if ( !this._orientationchangeInProgress ) {
137+
if ( !this._orientationchangeInProgress && this._isOpen ) {
134138
// effectively rapid-close the popup while leaving the screen intact
135139
this._ui.container
136140
.addClass( "ui-selectmenu-hidden" )

0 commit comments

Comments
 (0)