Dropdown list items rendered multiple times when bulk adding options
See original GitHub issueIt seems that render()
is called every time a choice is added and render removes all innerHTML DOM elements from the dropdown and recreates the list leading to poor performance with large sets, O(n2).
setChoices
calls _addChoice
in a loop which in turn calls store.dispatch
and store calls render on every state change.
The pattern seems to look like: render 1 - clear - render 1, render 2 - clear render 1, render 2, render3
Issue Analytics
- State:
- Created 6 years ago
- Comments:10
Top Results From Across the Web
Select2 performance for large set of items - Stack Overflow
The huge list of options doesn't show until the user has typed a couple of characters. This greatly reduces the performance hit while...
Read more >Insert a multiple-selection list box - Microsoft Support
A multiple-selection list box is list of choices that looks like a scrollable list of check boxes ... Enable users to select multiple...
Read more >Angular: Binding dropdown with huge data set | Coding In Depth
So when data increases, i.e. 10,000 plus dataset. The dropdown is so slow it takes a few seconds to open and render each...
Read more >Rendering large lists in React: 5 methods with examples
Lists are an integral part of most web applications because they help display data in a more presentable format. But, when an app...
Read more >Edit multiple records in a list using the list editor
To select multiple non-consecutive fields, press Shift and click in one of the desired fields, then hold Shift + Ctrl (Shift + Command...
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
Hi there, first of all: Thanks for the great work!
I just tested the
integrate-morphdom
branch to see if it is beneficial for our performance problems with choichesjs. I cannot say that it solved our issues. Maybe the search and update is faster. But adding a lot (aprox. 2000 Items) viasetItems
on an initially empty list still takes several seconds. I didn’t have time (nor the skills) to look deeper into this, but its pretty easy to reproduce like this:@stale no