Permalink
Browse files

Selectmenu: improved preventFocusZoom. Fixes #5333.

  • Loading branch information...
jaspermdegroot committed Nov 29, 2012
1 parent e282bfc commit 466cca641c2770dce4ae9ffc8c2bc3db064e10fc
Showing with 16 additions and 8 deletions.
  1. +16 −8 js/widgets/forms/select.js
View
@@ -185,17 +185,25 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
});
// In many situations, iOS will zoom into the select upon tap, this prevents that from happening
- self.button.bind( "vmousedown", function() {
- if ( self.options.preventFocusZoom ) {
+ if ( self.options.preventFocusZoom ) {
+ self.button.bind( "vmousedown", function() {
$.mobile.zoom.disable( true );
- }
- }).bind( "mouseup", function() {
- if ( self.options.preventFocusZoom ) {
+ });
+ self.label.bind( "click focus", function() {
+ $.mobile.zoom.disable( true );
+ });
+ self.select.bind( "focus", function() {
+ $.mobile.zoom.disable( true );
+ });
+ self.button.bind( "mouseup", function() {
setTimeout(function() {
$.mobile.zoom.enable( true );
- }, 0);
- }
- });
+ }, 0 );
+ });
+ self.select.bind( "blur", function() {
+ $.mobile.zoom.enable( true );
+ });
+ }
},
selected: function() {

0 comments on commit 466cca6

Please sign in to comment.