Permalink
Browse files

Selectmenu: improved preventFocusZoom. Fixes #5333.

  • Loading branch information...
1 parent de35dc4 commit b694e0765714bf78fef8fb70855aefd250cceb6d @jaspermdegroot jaspermdegroot committed Nov 29, 2012
Showing with 16 additions and 8 deletions.
  1. +16 −8 js/jquery.mobile.forms.select.js
View
24 js/jquery.mobile.forms.select.js
@@ -174,17 +174,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 b694e07

Please sign in to comment.