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.

Input filtering is laggy for large lists of options on v1.0.0-beta10

See original GitHub issue

Hi 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:closed
  • Created 8 years ago
  • Comments:7

github_iconTop GitHub Comments

3reactions
bvaughncommented, Aug 20, 2016

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

2reactions
bvaughncommented, Aug 17, 2016

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 vanilla react-select works fine for that.

I was tentatively thinking of creating another light-weight lib that connects js-worker-search and react-select so people wanting to filter large lists of options could use that library as their filterOptions property. So basically something like this…

import React from 'react'
import VirtualizedSelect from 'react-virtualized-select'
import fastFilterOptions from 'react-select-fast-filter-options'

function MyComponent () {
  return (
    <VirtualizedSelect
      {...props}
      filterOptions={fastFilterOptions}
    />
  )
}
Read more comments on GitHub >

github_iconTop 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 >

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