lordfriend / nya-bootstrap-select

An AngularJS select replacement which build select like dropdown component with collection and ng-model support
http://nya.io/nya-bootstrap-select/
MIT License
178 stars 80 forks source link

Extremely improve the initial load of dropdown #149

Closed martijnlentink closed 8 years ago

martijnlentink commented 8 years ago

When a large number of items are used in the dropdown everything is traversed to find to one to highlight, this fix will directly return the first selected option without enumeration.

lordfriend commented 8 years ago

Thanks for making this PR. But this resolution using :not selector in querySelector method may have compatibility issue in IE8. Because we still willing to support angular 1.2. IE8 compatibility should be considered

GedMarc commented 8 years ago

IE8 has been discontinued and has reached EOL, as has IE9. No compatibility for it should be considered.

lordfriend commented 8 years ago

Well, because AngularJS 1.2 doesn't drop support for IE8, we cannot simply ignore the compatibility with IE8 as long as we declare supporting for IE8.

martijnlentink commented 8 years ago

I merged both solutions with a IE8 check. This should speed it up for newer browsers and leaves IE8 with a working solution.

lordfriend commented 8 years ago

Thank you for you patient. But I think detect the existence of addEventListener for IE8 is not very reliable because someone can use a polyfills for DOM API which contains addEventListener. I've found a better special css3 selector detection http://fiddle.jshell.net/leaverou/Pmn8m/?utm_source=website&utm_medium=embed&utm_campaign=Pmn8m

martijnlentink commented 8 years ago

Cool! Nice find, I'll add that check.

lordfriend commented 8 years ago

Thanks for contribution!