Closed Bug 1533766 Opened 6 years ago Closed 6 years ago

[Search Quantumbar] Wrong search query after selecting a one click search engine with keyboard

Categories

(Firefox :: Address Bar, defect, P2)

defect

Tracking

()

RESOLVED FIXED
Tracking Status
firefox67 --- affected

People

(Reporter: laszlo.bialis, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fixed by bug 1527946])

Note

  • Make sure "browser.urlbar.quantumbar" is set to "true" in about:config

Affected versions

  • Nightly 67.0a1

Affected platforms

  • Win10 x64, macOS 10.14, Ubuntu 16.04

Steps to reproduce

  1. Enter a search query in the Quantumbar (use a previously unused query)
  2. Press "↓" key until one of the one-click search buttons are selected
  3. Hit Enter key
    Optional:
  4. Right click on the same or any other one-click search engine
  5. Select to Search in new tab

Expected result

  • Results should show using the search query typed in Quantumbar.

Actual result

  • If only search suggestions are available, after step 3 the search is done using the last search suggestion from the list, not the actual word typed in the Quantumbar.
  • Same happens (the last available search suggestion is taken in account) if steps 4 and 5 are made, but in a new tab.
  • The issue happens only with search suggestions, if the last item in the list is a history item, the search is done with the search query typed initially.

Additional notes

  • The issue affects Quantumbar only, I didn't encounter the issue in Awesomebar

I believe this is intentional... if you've arrowed down, you've essentially selected the last search suggestion. Then arrowing onto the one-offs, you're using that last selection.

If you alt-down (or up) to the one-offs (or click them) then it'll use the search suggestion you're on.

Hm, I think it's not intentional, because he arrowed down to one-offs, so the text in the input field has been reverted. The only thing selected is the one off.

If he'd alt-down from a suggestion to one-offs, then it would be right to use the suggestion (and there's a double selection, that Imo we should not have, anyway)

And by that I mean that I think the interaction should ideally work like this:
case a: down until one-offs are reached, the text is reverted and one-offs should act on what the user typed
case b: down until a suggestion, then move to one-offs (alt down, in the future just press TAB) the input text is still the one from the last selected suggestion, one-offs act on the suggestion text

Basically, one-offs should always act on what is in the input field, moving to one-offs should either reset the field or not depending on how we reached them (down reverts, alt+down doesn't).

Marco's right. The search string in this case is set here: https://searchfox.org/mozilla-central/rev/d6f8590a91b71d64a1d0471cac38b6aadbe2a6e2/browser/components/urlbar/UrlbarInput.jsm#306

So either _resultForCurrentValue is wrong or shouldn't be used, or this._lastSearchString is wrong or shouldn't be used, or both. Seems like we should just be using this.value? Since the input should contain the suggestion if a suggestion is highlighted, or the user's text if no suggestion is highlighted.

Priority: -- → P2

Bug 1527946 is fixing this.

Depends on: 1527946

does it include a test?

Confirming this doesn't happen anymore.

Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Whiteboard: [fixed by bug 1527946]
You need to log in before you can comment on or make changes to this bug.