components: MdSelect and MdAutocomplete slow initial render w/ large number of options
For both MdSelect
and MdAutocomplete
, the initial render of the component (in the closed state) is very slow even though the panels are closed. We should ensure that any work related to the options is deferred until the panel is opened.
To reproduce this, simply modify the demos to render 500 md-select
each with 500 options each (there is no problem if there are 500 selects with 1 option each).
About this issue
- Original URL
- State: open
- Created 7 years ago
- Reactions: 21
- Comments: 24 (12 by maintainers)
I’m running into this same issue with Select and cannot find a workaround. If I have 100s of select options the view hangs on load (setting values in onInit). Anyone found a workaround?
Any news on this?
@timharris777 I’ve worked around it by incrementally searching and loading a subset of the data. Code:
https://github.com/OasisDigital/angular-material-obs-autocomplete
demo:
https://oasisdigital.github.io/angular-material-obs-autocomplete/
What I like about this code: it works, yields a decent user experience, today. What I don’t like about it: It doesn’t “fix” the problem so much as avoided by implementing a different set of features, and it requires more work and understanding behind the scenes. See demo and demo code.