Skip to content
This repository
Browse code

Fixes #1459 — Clicking on a search input’s “clear” button now returns…

… focus to the search input.
  • Loading branch information...
commit cbe432016e8bfce952dfb979b4c77f20da9e0473 1 parent f0acc75
Mat Marquis authored March 02, 2012

Showing 1 changed file with 5 additions and 3 deletions. Show diff stats Hide diff stats

  1. 8  js/jquery.mobile.forms.textinput.js
8  js/jquery.mobile.forms.textinput.js
@@ -49,9 +49,11 @@ $.widget( "mobile.textinput", $.mobile.widget, {
49 49
 
50 50
 			focusedEl = input.wrap( "<div class='ui-input-search ui-shadow-inset ui-btn-corner-all ui-btn-shadow ui-icon-searchfield" + themeclass + miniclass + "'></div>" ).parent();
51 51
 			clearbtn = $( "<a href='#' class='ui-input-clear' title='clear text'>clear text</a>" )
52  
-				.tap(function( event ) {
53  
-					input.val( "" ).focus();
54  
-					input.trigger( "change" );
  52
+				.bind('click', function( event ) {
  53
+					input
  54
+						.val( "" )
  55
+						.focus()
  56
+						.trigger( "change" );
55 57
 					clearbtn.addClass( "ui-input-clear-hidden" );
56 58
 					event.preventDefault();
57 59
 				})

0 notes on commit cbe4320

Please sign in to comment.
Something went wrong with that request. Please try again.