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

Commit 466cca6

Browse files
Selectmenu: improved preventFocusZoom. Fixes #5333.
1 parent e282bfc commit 466cca6

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
@@ -185,17 +185,25 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
185185
});
186186

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

201209
selected: function() {

0 commit comments

Comments
 (0)