diff --git a/js/jquery.mobile.event.js b/js/jquery.mobile.event.js index 8475ac73a03..c1bdc90d050 100644 --- a/js/jquery.mobile.event.js +++ b/js/jquery.mobile.event.js @@ -70,6 +70,7 @@ $.event.special.tap = { var moved = false, touching = true, + origTarget = event.target, origPos = [ event.pageX, event.pageY ], originalType, timer; @@ -97,7 +98,10 @@ $.event.special.tap = { clearTimeout( timer ); touching = false; - if ( !moved ) { + /* ONLY trigger a 'tap' event if the start target is + * the same as the stop target. + */ + if ( !moved && (origTarget == event.target)) { originalType = event.type; event.type = "tap"; $.event.handle.call( thisObject, event ); diff --git a/js/jquery.mobile.forms.select.js b/js/jquery.mobile.forms.select.js index 6ee10c4fe39..713cc5869d6 100644 --- a/js/jquery.mobile.forms.select.js +++ b/js/jquery.mobile.forms.select.js @@ -172,8 +172,12 @@ $.widget( "mobile.selectmenu", $.mobile.widget, { if( !$(event.target).is("a") ){ return; } // index of option tag to be selected + /* :XXX: If we use 'options' from the current closure, then when + * the list is re-built, we won't have access to the new set + * of options. + */ var newIndex = list.find( "li:not(.ui-li-divider)" ).index( this ), - option = options.eq( newIndex )[0]; + option = select.find('option').eq( newIndex )[0]; // toggle selected status on the tag for multi selects option.selected = isMultiple ? !option.selected : true; diff --git a/js/jquery.mobile.navigation.js b/js/jquery.mobile.navigation.js index 81c711ed081..97b381b74c5 100644 --- a/js/jquery.mobile.navigation.js +++ b/js/jquery.mobile.navigation.js @@ -170,8 +170,14 @@ //reset base to pathname for new request if(base){ base.reset(); } - //kill the keyboard - $( window.document.activeElement ).add(':focus').blur(); + /* kill the keyboard + * + * :XXX: This CAN fail, and when it does, the failure shouldn't + * terminate changePage(). + */ + try { + $( window.document.activeElement ).add(':focus').blur(); + } catch(e) {}; function defaultTransition(){ if(transition === undefined){ @@ -190,7 +196,12 @@ // ensure a transition has been set where pop is undefined defaultTransition(); - } else { + /* :XXX: Only push the url/transition onto the urlStack if a + * destination URL was identified AND 'changeHash' is not + * explicitly false. Otherwise, the urlStack could become + * cluttered with empty urls, causing history navigation issues. + */ + } else if( changeHash !== false && url ) { // If no transition has been passed defaultTransition(); @@ -495,4 +506,4 @@ } } }); -})( jQuery ); \ No newline at end of file +})( jQuery );