Hitting Enter while Autocomplete popup is open can be confusing

RESOLVED FIXED in Firefox 63

Status

defect
P1
normal
RESOLVED FIXED
Last year
Last year

People

(Reporter: nchevobbe, Assigned: nchevobbe)

Tracking

(Blocks 1 bug)

unspecified
Firefox 63
Dependency tree / graph

Firefox Tracking Flags

(firefox63 fixed)

Details

(Whiteboard: [boogaloo-mvp])

Attachments

(1 attachment)

**Steps to reproduce**
1. Open the console
2. Type `d`
3. The autocompletion popup open, probably with `decodeUri` item appearing selected
4. Hit Enter

**Expected results**

Since there's an autocompletion popup item "selected", I expect the console to be filled with the selected item  (decodeUri)

**Actual results**

`d` gets evaluated

---

Enter only evaluate the selected autocomplete popup item if the user navigated the autocompletion list (with up or down arrow). This can be very confusing because 2 similar visual state can have different behavior.

The alternatives are the following: 
- Always select the autocomplete popup selected item, even if the user did not navigate the list (which is what Chrome and VsCode do). I guess it wasn't done that way because there might be cases when you want to evaluate what you just typed, and the autocomplete selected item is different from that ? This case shouldn't happen IMO if the autocompletion does its job correctly.
- Don't automatically select the first element from the autocompletion popup. I would be against this I think because then it requires 2 steps to autocomplete.
Victoria, what do you think of this ?
Blocks: 1458831
Flags: needinfo?(victoria)
Priority: -- → P2
Whiteboard: [boogaloo-mvp]
Yes! I agree completely with your reasoning on this (single-step, select first autocomplete item, press Enter to fill input with selected item). Easy enough to just keep typing or press ESC if the autocomplete isn't right.
Flags: needinfo?(victoria)
Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Priority: P2 → P1
Comment on attachment 8992647 [details]
Bug 1472080 - Make Enter always autocomplete the selected result; .

https://reviewboard.mozilla.org/r/257514/#review264412

Nice cleanup

::: commit-message-54714:1
(Diff revision 1)
> +Bug 1472080 - Better console input autocompletion behaviour; r=bgrins.

Please change this line to explain the behavior change. Maybe: "Make Enter always autocomplete the selected result" or something like that.
Attachment #8992647 - Flags: review?(bgrinstead) → review+
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/616da64bc004
Make Enter always autocomplete the selected result; r=bgrins.
https://hg.mozilla.org/mozilla-central/rev/616da64bc004
Status: ASSIGNED → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → Firefox 63
You need to log in before you can comment on or make changes to this bug.