r76510 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76509‎ | r76510 | r76511 >
Date:10:15, 11 November 2010
Author:catrope
Status:ok
Tags:
Comment:
(bug 25877) Don't focus search box when clicking SimpleSearch's magnifying class button
Modified paths:
  • /trunk/phase3/resources/jquery/jquery.placeholder.js (modified) (history)

Diff [purge]

Index: trunk/phase3/resources/jquery/jquery.placeholder.js
@@ -37,7 +37,14 @@
3838 // Blank on submit -- prevents submitting with unintended value
3939 .parents( 'form' )
4040 .bind( 'submit', function() {
41 - $input.trigger( 'focus' );
 41+ // $input.trigger( 'focus' ); is problematic
 42+ // because it actually focuses $input, leading
 43+ // to nasty behavior in mobile browsers
 44+ if ( $input.hasClass( 'placeholder' ) ) {
 45+ $input
 46+ .val( '' )
 47+ .removeClass( 'placeholder' );
 48+ }
4249 } );
4350 // Show initially, if empty
4451 if ( $input.val() == '' ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r765111.16wmf4: MFT r76510catrope10:19, 11 November 2010

Status & tagging log