Community Wishlist Survey 2021/Search/Start Wiki with cursor focus in search field

From Meta, a Wikimedia project coordination wiki

Start Wiki with cursor focus in search field

  • Problem: When starting the Wikipage one has to click the search field before entering the search text
  • Who would benefit: All persons who would like to search the Wikipedias - no disadvantage for users who use the links on the page (where a click is necessary anyway)
  • Proposed solution: Set the FOCUS of the cursor to the SEARCH field upon loading the Wikipedia page(s).
  • Phabricator tickets:
  • Proposer: Toko~dewiki (talk) 17:22, 23 November 2020 (UTC)[reply]


  • This is as simple as adding "autofocus" in the HTML search field <input type="search" ... autofocus> Geert Van Pamel (WMBE) (talk) 23:00, 23 November 2020 (UTC)[reply]
  • This can also be achieved by simple userscript (e.g., this one for when you are on the wiki's main page). --Matěj Suchánek (talk) 09:04, 24 November 2020 (UTC)[reply]
  • This historically has been controversial on en.wp. Most editors (as opposed to readers) find this autofocus behavior annoying and there have been several discussion on this topic in the past there. I do think those discussions haven't been had in a while however. —TheDJ (talkcontribs) 09:30, 24 November 2020 (UTC)[reply]
  • The same problem occurs in Wikidata after you request the creation of a new item; I would expect the cursor to be in the Label field, so I can start typing immediately? Geert Van Pamel (WMBE) (talk) 18:36, 26 November 2020 (UTC)[reply]
  • One problem with this is that the keyboard would no longer work for page navigation using the arrow keys or Page Down (at least on Mac OS). This would be better as a user script. Jonesey95 (talk) 14:31, 29 November 2020 (UTC)[reply]
  • This isn't a good idea as it'd significantly reduce the accessibility rating of every article on-wiki by interefering with keyboard navigation, as all keypresses would go into the search box. Auto-focus works well where the auto-focused action is intended to be the primary or only action on the page and no keyboard navigation is necessary, neither of which are true on articles. --Deskana (talk) 23:33, 30 November 2020 (UTC)[reply]
  • I agree that this wouldn't be a good default for all users. I, for example, have the "Search as you type" feature enabled in my browser which enables me to simply start typing to find something in a web page. This proposal would interfere with that when I'm reading Wikipedia. Silver hr (talk) 02:16, 1 December 2020 (UTC)[reply]
  • This will affect accessible users. Users who frequently use the search box only need to press the Tab key or an enabled widget/userscript.--YFdyh000 (talk) 23:03, 8 December 2020 (UTC)[reply]
  • I am frustrated due to this proposal's complete ignorance of users with accessibility issues. This function exists as gadgets that can be enabled on some wikis (which can be ported to other wikis easily), or you could make use of the accesskey keyboard shortcut, or use the "Jump to search" function on Vector. There are just so many existing ways that won't affect accessibility. H78c67c (talk) 01:25, 10 December 2020 (UTC)[reply]