New issue
Advanced search Search tips

Issue 911146 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Dec 18
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , iOS , Chrome , Mac , Fuchsia
Pri: 3
Type: Bug



Sign in to add a comment

Suppress autocomplete when user already typed suggestion

Project Member Reported by ftirelo@chromium.org, Dec 3

Issue description

Chrome Version: M71+
OS: all

What steps will reproduce the problem?
(1) Navigate to https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_form_autocomplete
(2) Type "abc" on the input field labeled "First name" and press "Submit"
(3) Reload the page, click on the input field, and click on the autocomplete suggestion.
(4) Click somewhere else in the page, and then on the input field again.

There is no much value in showing the autocomplete dropdown here. We should suppress it if we are only showing a single suggestion and that's exactly what is being shown on the input field.
 
Status: Assigned (was: Untriaged)
The fix for this bug will be much easier, and cleaner, to implement once this refactoring CL goes in:
https://chromium-review.googlesource.com/c/chromium/src/+/1351434

TL;DR; getting autocomplete suggestions is an asynchronous task, and the provided prefix (input box value) is lost from context between sending the request and receiving the response. With the refactoring, we can add the prefix as a value stored in the |pending_queries_| map and retrieve it upon receiving the response.
Project Member

Comment 2 by bugdroid1@chromium.org, Dec 18

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/850260abb34a6f53f3ca23a8e0f460249b9c80d6

commit 850260abb34a6f53f3ca23a8e0f460249b9c80d6
Author: Sebastien Lalancette <seblalancette@chromium.org>
Date: Tue Dec 18 17:22:47 2018

Suppress Autocomplete when user already typed unique suggestion.

E.g. user has suggestion "Bobby", and user types "Bobby", then we shouldn't show the unique and
equal (case-sensitive) suggestion.

Keep the prefix used to get suggestions in the new QueryHandler data structure. That
way, we can associate returned values with the request's context, and filter accordingly.

Added unit tests and tested manually in Chromium desktop.

Bug:  911146 
Change-Id: I1c2c69faee7051944348216fe6a3d0405d1ce357
Reviewed-on: https://chromium-review.googlesource.com/c/1377388
Commit-Queue: Sebastien Lalancette <seblalancette@chromium.org>
Reviewed-by: Sebastien Seguin-Gagnon <sebsg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#617543}
[modify] https://crrev.com/850260abb34a6f53f3ca23a8e0f460249b9c80d6/components/autofill/core/browser/autocomplete_history_manager.cc
[modify] https://crrev.com/850260abb34a6f53f3ca23a8e0f460249b9c80d6/components/autofill/core/browser/autocomplete_history_manager.h
[modify] https://crrev.com/850260abb34a6f53f3ca23a8e0f460249b9c80d6/components/autofill/core/browser/autocomplete_history_manager_unittest.cc

Status: Fixed (was: Assigned)
How to test:
- Go to: https://rsolomakhin.github.io/autofill/
- Submit some unique input in "Basic form key/value Autocomplete (unstructured data)" (e.g. qwerty1)
- Go back to the same input box.
- Type in the same input (e.g. qwerty1)

Expected result:
You should see "qwerty1" as an autocomplete suggestion as you type, but when you're done typing it, the pop-up should be hidden.

Sign in to add a comment