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

Commit 0c4b2f3

Browse files
author
Gabriel Schulhof
committed
[popup] "detached retina" fix - the window height on iStuff with a retina display seems to fluctuate by one pixel during scroll, causing a spurious resize event right after popup open, even though window size is constant during the entire opening sequence
1 parent 48e1674 commit 0c4b2f3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

js/widgets/popup.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,13 @@ define( [ "jquery",
134134

135135
_handleWindowResize: function( e ) {
136136
if ( this._isOpen ) {
137-
if ( !this._ui.container.hasClass( "ui-selectmenu-hidden" ) ) {
137+
if ( ( this._maybeRefreshTimeout() || this._orientationchangeInProgress ) &&
138+
!this._ui.container.hasClass( "ui-selectmenu-hidden" ) ) {
138139
// effectively rapid-close the popup while leaving the screen intact
139140
this._ui.container
140141
.addClass( "ui-selectmenu-hidden" )
141142
.removeAttr( "style" );
142143
}
143-
this._maybeRefreshTimeout();
144144
}
145145
},
146146

@@ -525,6 +525,7 @@ define( [ "jquery",
525525

526526
_completeOpen: function() {
527527
this._ui.container.attr( "tabindex", "0" ).focus();
528+
this._maybeRefreshTimeout();
528529
this._trigger( "afteropen" );
529530
},
530531

0 commit comments

Comments
 (0)