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

onSelect() called after getSources(), causing a closing delay of the dropdown #1170

Open
Grafikart opened this issue Jul 16, 2023 · 0 comments

Comments

@Grafikart
Copy link

Description

When selecting an item a new getSources is triggered (new sources are fetched) and is resolved before calling onSelect(). When working with slow API it prevent the dropdown to be closed while the data is fetched.

Reproduction

Preview of the problem

Steps

  1. Go on the codesandbox demo
  2. Fill the field with a street name "128 Aven" (it's in french)
  3. Wait till the suggestions appears
  4. Click on a suggestion and see how it load before calling onSelect

Expected behavior

I expect the autocomplete to close immediately when selecting a value.
I expect onSelect to be called before the new getSources call (it would allow me to prevent loading new async data).

Environment

  • OS: All
  • Browser: All
  • Autocomplete version: 1.10.0
@Grafikart Grafikart changed the title onSelect() called after getSources() onSelect() called after getSources(), causing a closing delay of the dropdown Jul 16, 2023
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

1 participant