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

Commit 5342dfd

Browse files
author
Gabriel Schulhof
committed
Popup: Ignore resize events right after a click
Closes gh-7323 Fixes gh-6961
1 parent fbe4cc6 commit 5342dfd

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

js/widgets/popup.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ $.widget( "mobile.popup", {
7575
history: !$.mobile.browser.oldIE
7676
},
7777

78+
// When the user depresses the mouse/finger on an element inside the popup while the popup is
79+
// open, we ignore resize events for a short while. This prevents #6961.
80+
_handleDocumentVmousedown: function( theEvent ) {
81+
if ( this._isOpen && $.contains( this._ui.container[ 0 ], theEvent.target ) ) {
82+
this._ignoreResizeEvents();
83+
}
84+
},
85+
7886
_create: function() {
7987
var theElement = this.element,
8088
myId = theElement.attr( "id" ),
@@ -85,6 +93,10 @@ $.widget( "mobile.popup", {
8593
// it is determined whether there shall be AJAX nav.
8694
currentOptions.history = currentOptions.history && $.mobile.ajaxEnabled && $.mobile.hashListeningEnabled;
8795

96+
this._on( this.document, {
97+
"vmousedown": "_handleDocumentVmousedown"
98+
});
99+
88100
// Define instance variables
89101
$.extend( this, {
90102
_scrollTop: 0,

0 commit comments

Comments
 (0)