Closed Bug 1524718 Opened 5 years ago Closed 5 years ago

Autofill should be restored after the heuristic result is re-selected

Categories

(Firefox :: Address Bar, defect, P1)

defect

Tracking

()

RESOLVED FIXED
Firefox 67
Tracking Status
firefox67 --- fixed

People

(Reporter: adw, Assigned: adw)

References

Details

Attachments

(1 file)

In the awesomebar, if the heuristic result is autofilled, and then you press the down arrow key to select the next result and then press up to re-select the heuristic result, the autofilled value is autofilled again, including restoring the autofill selection.

In the quantumbar, after you press the up arrow key to re-select the heuristic result, the full URL is put in the input instead, and there's no selection.

We should replace the context.autofillValue property with a result.autofill property. When the view selects results, it already notifies the input about it by calling input.setValueFromResult(). So we can modify setValueFromResult to check for the presence of result.autofill and thereby get autofill "for free". (The one place where the view doesn't call input.setValueFromResult() when a result is selected is when it selects the preselected result, so this patch adds that.)

result.autofill is an object: { value, selectionStart, selectionEnd }

This is going to help me implement bug 1521702.

One potentially cool thing about doing autofill this way is that any result can now trigger autofill, not only the heuristic result, and do it easily. Of course the user isn't typing when they select a non-heuristic result, so it's probably not fair to call that "autofill", but the result can trigger the selection aspect of autofill. As one example, that might be interesting for search suggestions: Type "foo", key down to the "foobar" suggestion, and the "bar" substring is automatically selected.

Attachment #9041328 - Attachment description: Bug 1524718 - Replace context.autofill with result.autofill, and autofill results when they're selected. → Bug 1524718 - Replace context.autofillValue with result.autofill, and autofill results when they're selected.
Pushed by dwillcoxon@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f89acdbfa432
Replace context.autofillValue with result.autofill, and autofill results when they're selected. r=mak

I just noticed this patch breaks search alias autofill too.

Flags: needinfo?(adw)
Pushed by dwillcoxon@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e37833d71cd1
Replace context.autofillValue with result.autofill, and autofill results when they're selected. r=mak
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 67
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: