Page MenuHomePhabricator

Search box to gain initial focus on main page
Closed, ResolvedPublic


Author: darylb

When visiting the "Main Page" for English
(, it would be nice if the cursor
automatically appeared in the search box like it does for the home page
( Without this, each person must first click on the
search box before starting to type any search terms.

This can be fixed by adding the following JavaScript to the wikibits.js file in
the runOnloadHook() function just before the "Run any added-on functions" section.

// Send focus to search box by default.
var sInput = document.getElementById("searchInput");
if (typeof sInput != 'undefined') {

NOTE: This may scroll the page depending on the location of the search box. For example, in the print layout the page scrolls down to the search box.

Version: 1.16.x
Severity: normal
OS: Windows XP
Platform: PC



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:19 PM
bzimport set Reference to bz6165.
bzimport added a subscriber: Unknown Object (MLST).
  • This bug has been marked as a duplicate of 1864 ***