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

Commit b694e07

Browse files
Selectmenu: improved preventFocusZoom. Fixes #5333.
1 parent de35dc4 commit b694e07

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

js/jquery.mobile.forms.select.js

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

176176
// In many situations, iOS will zoom into the select upon tap, this prevents that from happening
177-
self.button.bind( "vmousedown", function() {
178-
if( self.options.preventFocusZoom ){
177+
if ( self.options.preventFocusZoom ) {
178+
self.button.bind( "vmousedown", function() {
179179
$.mobile.zoom.disable( true );
180-
}
181-
}).bind( "mouseup", function() {
182-
if ( self.options.preventFocusZoom ) {
180+
});
181+
self.label.bind( "click focus", function() {
182+
$.mobile.zoom.disable( true );
183+
});
184+
self.select.bind( "focus", function() {
185+
$.mobile.zoom.disable( true );
186+
});
187+
self.button.bind( "mouseup", function() {
183188
setTimeout(function() {
184189
$.mobile.zoom.enable( true );
185-
}, 0);
186-
}
187-
});
190+
}, 0 );
191+
});
192+
self.select.bind( "blur", function() {
193+
$.mobile.zoom.enable( true );
194+
});
195+
}
188196
},
189197

190198
selected: function() {

0 commit comments

Comments
 (0)