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

Commit 9610f80

Browse files
Selectmenu: the preventFocusZoom option check needs to be insde the event binding.
1 parent 4a28059 commit 9610f80

File tree

1 file changed

+24
-15
lines changed

1 file changed

+24
-15
lines changed

js/widgets/forms/select.js

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -186,25 +186,34 @@ $.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-
if ( self.options.preventFocusZoom ) {
190-
self.button.bind( "vmousedown", function() {
191-
$.mobile.zoom.disable( true );
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() {
189+
self.button.bind( "vmousedown", function() {
190+
if ( self.options.preventFocusZoom ) {
191+
$.mobile.zoom.disable( true );
192+
}
193+
});
194+
self.label.bind( "click focus", function() {
195+
if ( self.options.preventFocusZoom ) {
196+
$.mobile.zoom.disable( true );
197+
}
198+
});
199+
self.select.bind( "focus", function() {
200+
if ( self.options.preventFocusZoom ) {
201+
$.mobile.zoom.disable( true );
202+
}
203+
});
204+
self.button.bind( "mouseup", function() {
205+
if ( self.options.preventFocusZoom ) {
200206
setTimeout(function() {
201207
$.mobile.zoom.enable( true );
202208
}, 0 );
203-
});
204-
self.select.bind( "blur", function() {
209+
}
210+
});
211+
self.select.bind( "blur", function() {
212+
if ( self.options.preventFocusZoom ) {
205213
$.mobile.zoom.enable( true );
206-
});
207-
}
214+
}
215+
});
216+
208217
},
209218

210219
selected: function() {

0 commit comments

Comments
 (0)