amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

Autosuggest not working properly for same query

Open Kishan08 opened this issue 8 years ago • 3 comments

I'm playing with the Autosuggest example here. And found some issues.

What's the issue?

Suppose I want to search for 'California' in City input box. When I write a query like 'ca', it'll shows all the cities that contains word 'ca', now after removing the query from input box if i again try to search with the same query ['ca'] then it doesn't show any result in amp-selector component. But if I modify it like 'ca' wait for a second and then enter 'l', then it shows cities with matching word. This happens every time when I try to search with same query.

How do we reproduce the issue?

Here's a GIF for the reference.

What browsers are affected?

Latest version of Chrome and Firefox.

Which AMP version is affected?

Version 1516337355291

Kishan08 avatar Jan 23 '18 08:01 Kishan08

Any update?

Kishan08 avatar Jan 24 '18 12:01 Kishan08

It's not a bug. It's a feature. :). Currently they used input-debounce event for the example. The debounce time is 300ms. if have any changes when the time end it will call API( in your case it's not). If change to input-throttled event this issue will be fixed but we will face with performance issue or gotten the incorrect search result(due to call API many times). I think this issue is not a big deal here

buihoanghai avatar Jan 24 '18 15:01 buihoanghai

Aha, thanks for the suggestion. Will close the issue.

Kishan08 avatar Jan 25 '18 07:01 Kishan08