Page MenuHomePhabricator

[S] Don't focus on search input when displaying search results in Special:Search
Closed, ResolvedPublic

Description

On [[Special:Search]] focus is always set on the search input field. This is useful when making a new search. But when showing results from a previous search you want to be able to scroll down without having to unfocus first.

Exepcted behaviour:

  • visiting [[Special:Search]] without search results:
    • focus is on search input
    • you can start typing your search
  • visiting [[Special:Search/Some search]] displaying search results:
    • focus it is not on input
    • (not having to unfocus) start scrolling using PageDown/PageUp or arrow keys

This was fixed for earlier versions of search (then used by Wikipedia) in T11939 and T78637, but is now broken again (Regression).

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Liuxinyu970226 subscribed.

No need to add this tag if there's already a project that focus on specific special pages.

The fix for T78637 was only one line of changed code. Is this much more complicated to fix now?

Should this really be low priority? It is a really annoying bug that was fixed in earlier search versions and worked fine but was then broken again.

Now every time you view search results focus is on the input box at the top of [[Special:Search]] instead of the results. Even when you have scrolled down and clicked a result and then go back to the search results. Then you have to unfocus and scroll down again to continue looking through the results. This is not how search engines like Google or Bing works. They only focus on the input box when you start a new search, not when looking at results.

This is also a very annoying behaviour when you are trying to do something in the default search box and it changes your focus to search input inside the page. It is also an accessibility failure, I would say. Sad to not see this fixed for years.

Hi, thanks for bringing this up. This request was marked as low priority in relation to other high priority work, which is not to say that it isn't important for some people. Additionally, the desired keyboard scrolling functionality is possible by pressing the Tab key first to move focus from the search input field.

CBogen renamed this task from Don't focus on search input when displaying search results in Special:Search to [S] Don't focus on search input when displaying search results in Special:Search.Jun 29 2022, 4:20 PM

Change 813241 had a related patch set uploaded (by Simone Cuomo; author: Simone Cuomo):

[mediawiki/extensions/AdvancedSearch@master] Don't focus on search input when displaying results in Special:Search

https://gerrit.wikimedia.org/r/813241

Change 813241 merged by jenkins-bot:

[mediawiki/extensions/AdvancedSearch@master] Don't focus on search input when displaying results in Special:Search

https://gerrit.wikimedia.org/r/813241

Etonkovidova subscribed.

Checked on commons betalabs (Special:Search) and production enwiki wmf.27- works as expected:

Exepcted behaviour:

    • visiting [[Special:Search]] without search results:
    • focus is on search input
    • you can start typing your search
  • visiting [[Special:Search/Some search]] displaying search results:
    • focus it is not on input
    • (not having to unfocus) start scrolling using PageDown/PageUp or arrow keys

Comparing to the Special:MediaSearch input behavior (in wmf.25), I filed a minor issue for Special:MediaSearch - T316174