From 3b9721d0550516aaa62a4d53cac6fc96734daf75 Mon Sep 17 00:00:00 2001 From: Namit Date: Wed, 17 Dec 2014 11:31:04 +0530 Subject: [PATCH] Special:Search Don't autofocus search bar unless it is empty This interferes with scrolling through the results using the arrow keys.The user would first have to defocus the text box by clicking outside it or pressing Tab. Bug: T78637 Change-Id: Ic88e70c8e2308797b39c707984d77405369ae46c --- RELEASE-NOTES-1.25 | 1 + includes/specials/SpecialSearch.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES-1.25 b/RELEASE-NOTES-1.25 index 00bc155a4c..77dc55b5d6 100644 --- a/RELEASE-NOTES-1.25 +++ b/RELEASE-NOTES-1.25 @@ -115,6 +115,7 @@ production. and MovePage::checkPermissions(). * The Special:WhatLinksHere page linked from 'Number of redirects to this page' on action=info about a file page does not list file links anymore. +* (T78637) Search bar is not autofocused unless it is empty so that proper scrolling using arrow keys is possible. === Action API changes in 1.25 === * (T67403) XML tag highlighting is now only performed for formats diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index a7dea88c9d..031dbd7063 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -1064,7 +1064,7 @@ class SpecialSearch extends SpecialPage { $out .= Html::input( 'search', $term, 'search', array( 'id' => $this->profile === 'advanced' ? 'powerSearchText' : 'searchText', 'size' => '50', - 'autofocus', + 'autofocus' => trim( $term ) === '', 'class' => 'mw-ui-input mw-ui-input-inline', ) ) . "\n"; $out .= Html::hidden( 'fulltext', 'Search' ) . "\n"; -- 2.20.1