Page MenuHomePhabricator

Search box sometimes deletes part of what the user types and goes to the wrong page
Closed, ResolvedPublic

Description

I've experienced this problem for a long time now (at least one year!), but usually I'm not able to reproduce it. The steps are more or less as follows:

  1. Open the following page in a new (anonymous) window, using Google Chrome (tried with version 28.0.1500.71):

https://en.wikipedia.org/wiki/Special:BlankPage?uselang=en

  1. Click in the search box
  2. Type "Special:Prefix" and wait for the list of suggestions
  3. Press the down arrow to select the first suggestion, which is "Special:PrefixIndex". This will change the content of the search field to this title.
  4. Type "/A" after to get "Special:PrefixIndex/A" and press ENTER

At this point, I'm taken to the page
https://en.wikipedia.org/wiki/Special:PrefixIndex
instead of what I want:
https://en.wikipedia.org/wiki/Special:PrefixIndex/A


Version: 1.22.0
Severity: normal

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:04 AM
bzimport set Reference to bz51900.
bzimport added a subscriber: Unknown Object (MLST).

Created attachment 12935
Screencast

Attached:

I can't reproduce this, but I can reproduce a very similar behaviour with a different search using Firefox 10:

  1. Go to https://en.wikipedia.org/wiki/Special:BlankPage?uselang=en (or any other page)
  2. Focus the search box.
  3. Type "down".
  4. Press the down arrow to select "Download".
  5. Type ":".
  6. Press ENTER *quickly*.

This removes the colon (like the "/A" is removed in the screencast) and takes you to https://en.wikipedia/wiki/Download.

If you wait some time before you press ENTER in step 6, you will correctly be sent to http://dumps.wikimedia.org/.

I was now able to reproduce the original example. This also happens in Monobook skin, so this bug is MediaWiki core, probably in https://git.wikimedia.org/blob/mediawiki%2Fcore.git/e617dc6c8f2ce1d867ddadcd4bc3de098a84ff07/resources%2Fjquery%2Fjquery.suggestions.js#L409: When you press ENTER and there is still a selected suggestion, this suggestion will be used instead of what you entered in the search box.

Should be easy to fix, now that the issue is known :)

matmarex renamed this task from Search box deletes part of what the user types and go to the wrong page to Search box sometimes deletes part of what the user types and goes to the wrong page.Jan 1 2015, 9:34 PM
matmarex set Security to None.
matmarex removed a subscriber: Unknown Object (MLST).

Change 182427 had a related patch set uploaded (by M4tx):
Don't replace user text with suggestion in searchbox

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

Patch-For-Review

Change 182427 merged by jenkins-bot:
Don't replace user text with suggestion in searchbox

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