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

fix(smart-search-bar): Debouncing dropdown updates #62556

Merged

Conversation

ArthurKnaus
Copy link
Member

@ArthurKnaus ArthurKnaus commented Jan 3, 2024

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 of setState are included in the debounced logic and executed on the trailing call.

Screen.Recording.2024-01-03.at.16.16.54.mov

@ArthurKnaus ArthurKnaus requested a review from a team January 3, 2024 15:35
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jan 3, 2024
@ArthurKnaus ArthurKnaus requested a review from a team January 3, 2024 15:38
@ArthurKnaus ArthurKnaus changed the title Aknaus/fix/smart search bar/debouncing dropdown updates fix(smart-search-bar): Debouncing dropdown updates Jan 3, 2024
Copy link
Member

@billyvg billyvg left a 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

@ArthurKnaus ArthurKnaus requested review from a team as code owners January 3, 2024 15:56
@ArthurKnaus ArthurKnaus merged commit e018852 into master Jan 4, 2024
39 checks passed
@ArthurKnaus ArthurKnaus deleted the aknaus/fix/smart-search-bar/debouncing-dropdown-updates branch January 4, 2024 07:50
Copy link

sentry-io bot commented Jan 5, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ TypeError: q1[r2c] is not a function String.<computed>.<computed>(<anonymous>) View Issue
  • ‼️ Error: API Request Error <object>.error(app/api) View Issue

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.
@github-actions github-actions bot locked and limited conversation to collaborators Jan 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants