Input filtering is laggy for large lists of options on v1.0.0-beta10
See original GitHub issueHi there, first of all, thank you for this beautiful React component.
Now, here’s the problem with it 😉))
I have an options list with about 2000 items, e.g.
const options = Array.apply(0, Array(2000)).map(function (_i, i) { return i; }).map((i) => ({
value: ('my_value_numero_' + i), label: ('MyLabelStart - (Numero ' + i + ')')
}))
Then, simply render the Select
component via
function onChange(values) {
console.log('Not even doing anything')
}
ReactDOM.render(<Select
multi=true
value={[]}
options={options}
onChange={onChange}
/>, domNode)
Typing something into the input feels very laggy on v1.0.0-beta10
. On v0.9.1
it is fine.
It is really quiet significant of a difference. v0.9.1
is really smooth, while v1.0.0-beta10
is laggy.
(If you need an actual production example I can sent you my data via e-mail, but I tried to construct data good enough to reproduce the problem above.)
Issue Analytics
- State:
- Created 8 years ago
- Comments:7
Top Results From Across the Web
How to fix lag on select element containing a large list of options
I used "filterOptions" to show first 500 items and other items still be matched when searched, like this.
Read more >Solved: Issue with laggy gallery - Power Platform Community
Solved: Hello! I got a gallery with multiple labels in it and some controls etc. and these are connected to a sharepoint list....
Read more >How To Fix Discord Lagging | HP® Tech Takes
Sometimes, your current settings can cause lag issues. Check to see if this feature is on or off in Discord by clicking on...
Read more >Photoshop lags, freezes, or runs slowly - Adobe Support
Try the suggested solutions on this page if Photoshop lags, freezes, stutters, or runs slower than expected on your computer.
Read more >MacOS Big Sur Lagging | Apple Developer Forums
Help please, after updating the system to Big Sur, my MacBook Pro 13 began to slow down, ... Before upgrading everything was fine...
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 FreeTop 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
Top GitHub Comments
New high-order component available to hopefully speed things up a lot!
Demo available here with 100,000 options: https://bvaughn.github.io/react-select-fast-filter-options/
Source and installation instructions here: https://github.com/bvaughn/react-select-fast-filter-options
To add a little more context…
I like using high-order components for this sort of functionality because (a) it doesn’t bloat or add complexity to the underlying library (
react-select
) and (b) it lets users opt-in if they need the functionality. Lots of users just want a simple, styled drop-down menu and vanillareact-select
works fine for that.I was tentatively thinking of creating another light-weight lib that connects
js-worker-search
andreact-select
so people wanting to filter large lists of options could use that library as theirfilterOptions
property. So basically something like this…