dashboard
dashboard copied to clipboard
LabeledSelect performs poorly with >20 item lists
Seen during rancher/dashboard#8965 , where there are ~800 vm sizes available in the default region.
This appears to be a consequence of changes here https://github.com/rancher/dashboard/pull/8154/files - getOptionLabel runs for each option, so in the azure aks case we're iterating over 800 options 800 times...
Any fix here needs to ensure https://github.com/rancher/dashboard/issues/8149 isn't reintroduced, particularly the behavior seen in https://github.com/rancher/dashboard/pull/8133
Reopening due to additional findings in https://github.com/rancher/dashboard/issues/9900 - this problem is affecting more dropdowns than I previously realized; it appears to hit lists as small as 20 items.
Tested this with the recommended EC2 Instance Type select and the options render without any notable delay. I also tested other selects throughout dashboard, most do not have quite as many options in the list, the second most populated that I discovered was located under Deployment => Create => Container-0 => Security Context => Add Capabilities/Drop Capabilities; this, and others, rendered options without any notable delays as well.