-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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(smart-search-bar): Debouncing dropdown updates #62556
Merged
ArthurKnaus
merged 3 commits into
master
from
aknaus/fix/smart-search-bar/debouncing-dropdown-updates
Jan 4, 2024
Merged
fix(smart-search-bar): Debouncing dropdown updates #62556
ArthurKnaus
merged 3 commits into
master
from
aknaus/fix/smart-search-bar/debouncing-dropdown-updates
Jan 4, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
obostjancic
approved these changes
Jan 3, 2024
billyvg
approved these changes
Jan 3, 2024
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.
Nice fix, this has bugged me in the past
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
armenzg
pushed a commit
that referenced
this pull request
Jan 8, 2024
#### Solution Move the scope of debouncing from the tag value getters to `updateAutoCompleteItems`. That way also the calls of `setState` are included in the debounced logic and executed on the trailing call and the UI is updated accordingly.
trillville
pushed a commit
that referenced
this pull request
Jan 19, 2024
#### Solution Move the scope of debouncing from the tag value getters to `updateAutoCompleteItems`. That way also the calls of `setState` are included in the debounced logic and executed on the trailing call and the UI is updated accordingly.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
We debounce the functions that get / fetch token values. However, the trailing call of a debounced function is not returned. Therefore, the dropdown of the search bar can end up in the wrong state after quickly succeeding keystrokes.
e.g. here the tag values are not being filtered correctly:
Screen.Recording.2024-01-03.at.16.17.25.mov
Solution
Move the scope of debouncing from the tag value getters to
updateAutoCompleteItems
. That way also the calls ofsetState
are included in the debounced logic and executed on the trailing call.Screen.Recording.2024-01-03.at.16.16.54.mov