Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autoComplete: false not work (expected enter key) #347

Open
ChR-iSz opened this issue Oct 4, 2022 · 2 comments
Open

autoComplete: false not work (expected enter key) #347

ChR-iSz opened this issue Oct 4, 2022 · 2 comments

Comments

@ChR-iSz
Copy link

ChR-iSz commented Oct 4, 2022

Hello,

i don't want the autocomplete option. I don't spam the provider every 250ms.

So, my Question, if i set autoComplete: false, the search result if i press enter is not showing. If i press enter, it looks the map center to the first result. But i don't see the dropdown results if i press enter...

@smeijer
Copy link
Owner

smeijer commented Oct 4, 2022

That's working as its (currently) intended. If you don't want to spam the server every 250ms, but do want to show suggestions, you'll need to increase the autoCompleteDelay duration.

@dmx-patrick
Copy link

In the onSubmit method the resultList is cleared but this is only available when autoComplete is enabled and throws an error when setting autoComplete option to false.

this.resultList.clear();

Suggested solutions:

Call the clearResults method instead of directly clearing the resultList

this.clearResults();

or check the autoComplete option first before calling the clear

const { autoComplete } = this.options;

if (autoComplete) {
  this.resultList.clear();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants