[UnifiedComplete] Broken completion after selecting with the keyboard, then editing

RESOLVED DUPLICATE of bug 1185183

Status

()

Toolkit
Places
RESOLVED DUPLICATE of bug 1185183
2 years ago
2 years ago

People

(Reporter: mbrubeck, Assigned: mbrubeck)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(firefox42 affected)

Details

Attachments

(1 attachment)

(Assignee)

Description

2 years ago
Steps to reproduce (in Firefox Nightly with browser.urlbar.unifiedcomplete enabled):

1. Begin typing a URL in the address bar.
2. Press the "down" key to select the second entry in the autocomplete list.
3. Type more letters (or backspace) to edit the URL, such that the autocomplete popup now shows a different suggestion in the second entry.
4. Press Enter.

Expected result: The URL selected in step 2 loads.

Actual result; The URL of the new second autocomplete suggestion loads, even though it is not the URL in the address bar when you press Enter.

This happens because, when unifiedcomplete is enabled, the urlbar autocomplete binding resets the selectedIndex to 0 when new autocomplete results are added...

https://hg.mozilla.org/mozilla-central/file/e7e69cc8c07b/browser/base/content/urlbarBindings.xml#l1637

...but nsAutoCompleteController's "mCompletedSelectionIndex" is still set (incorrectly) to 1, so in EnterMatch it will overwrite the user-entered value with whatever value is now at index 1:

https://hg.mozilla.org/mozilla-central/file/e7e69cc8c07b/toolkit/components/autocomplete/nsAutoCompleteController.cpp#l1339

This patch invalidates mCompletedSelectionIndex when the popup is invalidated.  This fixes the problem, but I'm not sure whether it's the best fix.

This may be related to bug 1173202.

Updated

2 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1185183
You need to log in before you can comment on or make changes to this bug.