ui-select icon indicating copy to clipboard operation
ui-select copied to clipboard

To many elements in dom

Open emikelsoft opened this issue 12 years ago • 5 comments

Is it possible to add the items dynamically to the dom only when needed, e.g. when the user searches or opens the searchresult? The problem is if you have a lot of ui-select elements on a single page you produce a lot of bindings /watches and it quickly slows down the performance. In our special case we have 6 ui-selects for currencies and another 6 for countries, this leads to +2500 items in the dom and slowing down the page.

emikelsoft avatar Sep 10 '14 11:09 emikelsoft

the ui-scroll directive solves your problem for a price of making you implement the logic of the dropdown and selection yourself.

There was a request to marry the ui-scroll and ui-select, and it is possible, I just do not have the bandwidth at the moment

mfeingold avatar Sep 10 '14 13:09 mfeingold

I actually have some similar performance issues like this too, I plan to do some improvements on this at v0.10+

dimirc avatar Sep 12 '14 01:09 dimirc

this change might cause another serious performance issue, if I have 500 items each time when i open and close the dropdown list all these 500 items will be re-rendered and destroyed again and again.....

edenchen123 avatar Jan 26 '15 19:01 edenchen123

//.attr('ng-if', '$select.open') //Prevent unnecessary watches when dropdown is closed

edenchen123 avatar Jan 26 '15 19:01 edenchen123

@edenchen123 originally we were using ng-show but that was causing that even if the dropdown is closed, to have all the watches fired. In case you only have 1 or 2 ui-select on the page it wont be an issue, but if using multiple controls with many items, then that was a big performance hit.

dimirc avatar Feb 18 '15 04:02 dimirc