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

Commit 1f11c38

Browse files
Selectmenu: improved preventFocusZoom. Fixes #5333.
1 parent 07072e3 commit 1f11c38

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

js/widgets/forms/select.js

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -186,17 +186,25 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
186186
});
187187

188188
// In many situations, iOS will zoom into the select upon tap, this prevents that from happening
189-
self.button.bind( "vmousedown", function() {
190-
if ( self.options.preventFocusZoom ) {
189+
if ( self.options.preventFocusZoom ) {
190+
self.button.bind( "vmousedown", function() {
191191
$.mobile.zoom.disable( true );
192-
}
193-
}).bind( "mouseup", function() {
194-
if ( self.options.preventFocusZoom ) {
192+
});
193+
self.label.bind( "click focus", function() {
194+
$.mobile.zoom.disable( true );
195+
});
196+
self.select.bind( "focus", function() {
197+
$.mobile.zoom.disable( true );
198+
});
199+
self.button.bind( "mouseup", function() {
195200
setTimeout(function() {
196201
$.mobile.zoom.enable( true );
197-
}, 0);
198-
}
199-
});
202+
}, 0 );
203+
});
204+
self.select.bind( "blur", function() {
205+
$.mobile.zoom.enable( true );
206+
});
207+
}
200208
},
201209

202210
selected: function() {

0 commit comments

Comments
 (0)