-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
fix(web): add debounce to location search #9074
fix(web): add debounce to location search #9074
Conversation
web/src/lib/components/shared-components/change-location.svelte
Outdated
Show resolved
Hide resolved
Can't we just abort the previous request ? |
isSearching = false; | ||
showSpinner = false; | ||
if (latestSearchTimeout) { | ||
clearTimeout(latestSearchTimeout); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we just abort the previous request ?
@martabal Yes, abort if no requests have been sent, if already sent then ignore the result.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I mean using an AbortController. The timeout is used to avoid the loading spinner from blinking.
The search input on change location dialog ignore changes when search is in place leading to issue #9061. This PR fixes it by adding debounce on the input.