Menu rendering should be delayed until new options arrive
See original GitHub issueVersion
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:
- Created 6 years ago
- Reactions:1
- Comments:10 (6 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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).@derwaldgeist My bad, I missed that last bit.