From 466cca641c2770dce4ae9ffc8c2bc3db064e10fc Mon Sep 17 00:00:00 2001 From: Jasper de Groot Date: Thu, 29 Nov 2012 13:58:47 +0100 Subject: [PATCH] Selectmenu: improved preventFocusZoom. Fixes #5333. --- js/widgets/forms/select.js | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/js/widgets/forms/select.js b/js/widgets/forms/select.js index b656ab86d4f..9b60ac9b0cd 100644 --- a/js/widgets/forms/select.js +++ b/js/widgets/forms/select.js @@ -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() {