question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Menu rendering should be delayed until new options arrive

See original GitHub issue

Version

1.4.2

Steps to reproduce

Create an <AsyncTypeahead> with minLength=3. After the user types in the third character, a search is executed and the results are shown, just as expected.

The user then deletes all characters and starts typing again, with another search query term. After the third keystroke, a new search is being executed, but in the meantime the dropdown menu shows up, showing the results of the first query. Once the results of the second query come in, the drop down menu is re-rendered. This leads to user confusion and interface flickering.

(The problem is independent of minLength, but is more prominent when using it.)

Expected Behavior

Async Typeahead should wait after a query is being executed until new (changed) options arrive.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
ericgiocommented, Oct 27, 2017

This is happening because of the debouncing that’s built into the async version. There’s a delay between the time the user has finished typing and when the onSearch callback fires, during which other things might happen immediately. This is admittedly weird, so I’ll have to think about what the right behavior is and how it might be fixed (eg: temporarily suppressing the menu).

1reaction
pmcavoy89commented, Oct 26, 2017

@derwaldgeist My bad, I missed that last bit.

Read more comments on GitHub >

github_iconTop Results From Across the Web

'keepMounted' property on Material UI Select component not ...
The delay is due to Portal ( Menu uses Popover which uses Modal which uses Portal ) triggering the rendering of its children...
Read more >
Optimize your react-select component to smoothly render ...
Aug 09, 2021 by Sumit Bajracharya - In this post we cover a few react-select dropdown performance tips.
Read more >
Slow rendering - Android Developers
If your app suffers from slow UI rendering, then the system is forced to skip frames and the user will perceive stuttering in...
Read more >
Lazy loading - Web performance | MDN
Fonts. By default, font requests are delayed until the render tree is constructed, which can result in delayed text rendering. It is possible...
Read more >
How to Fix Render Blocking JavaScript in WordPress
Generally speaking, the browser needs to load a queue of JS, CSS, and HTML files before the user can see the main content....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found