Closed Bug 1538117 Opened 5 years ago Closed 5 years ago

Some typed chars get eaten by Quantum Bar autofill

Categories

(Firefox :: Address Bar, defect, P1)

defect

Tracking

()

RESOLVED FIXED
Firefox 68
Tracking Status
firefox-esr60 --- unaffected
firefox66 --- disabled
firefox67 --- disabled
firefox68 + fixed

People

(Reporter: mak, Assigned: adw)

References

Details

Attachments

(1 file)

This seems to be a recent regression, probably related to the autofill placeholder, not sure though.

When I type a bookmark keyword that is also the start of an autofill entry, the last letter gets eaten.
For example if I create a "go" keyword, and I type "go" it gets autofilled to g[oogle] instead of go[ogle] and when I press space to type the word to search with the go keyword, I end up on "g word"

Drew, could you please have a look at this?

Flags: needinfo?(adw)

It seems to also happen with dots, if I type "192." I get "192[.168.1.1]" instead of "192.[168.1.1]"

And also token aliases, If I type @amazon I end up at @amazo[n]

Assignee: nobody → adw
Status: NEW → ASSIGNED
Flags: needinfo?(adw)

_autofillValueOnInput correctly uses the placeholder string as the autofilled value, but it incorrectly uses _lastSearchString as the current input value. _lastSearchString at that point is -- yes -- the previous search string, not what the user has just typed. So when _autofillValueOnInput sets selectionStart to _lastSesarchString.length, the length is one char less than what it should be.

But why does that mess up only the last char typed and not every char? Because when the first result comes in, we correctly autofill it. It's only when the first result is not an autofill result that the incorrect placeholder autofill sticks around -- e.g., just after you type the last char in an @ alias.

This patch just gets rid of _autofillValueOnInput and inlines the body in _maybeAutofillOnInput.

Pushed by dwillcoxon@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/565644972ec2
Fix autofill when typing the last character of an autofilled value. r=mak
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 68

if we uplift the other fixes we'll need this one too, right?

Blocks: 1529931

(In reply to Marco Bonardo [::mak] from comment #9)

if we uplift the other fixes we'll need this one too, right?

Marco knows the answer, but just for others and posterity, it looks like we're now targeting beta 68 for experiments, not 67, so we don't need to uplift this.

https://hg.mozilla.org/projects/ash/rev/565644972ec23f4a8e54b60efc793b0e23e6d84a
Bug 1538117 - Fix autofill when typing the last character of an autofilled value. r=mak
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: