https://kotlinlang.org logo
Title
k

K Merle

08/08/2022, 1:59 PM
How do you load a lot of items in
ExposedDropdownMenu
UI freezes for me if there are to many items.
j

Jessica Ernst

08/08/2022, 4:37 PM
how many items? my biggest exposed that I have, has 31 items and no Problem like that
k

K Merle

08/08/2022, 4:37 PM
Around 300 😄
It's more like auto-complete TextField
j

Jessica Ernst

08/08/2022, 4:39 PM
wow that doesn’t sound like a good idea, not just for freezing screen but which user wants to scroll through 300 items in a exposed dropdown?
I wouldn’t want it to be honest
k

K Merle

08/08/2022, 4:40 PM
That's true.
I am still not sure if I should have UI issues, or I'm doing something wrong.
j

Jessica Ernst

08/08/2022, 4:45 PM
I think yes that there comes ui issues I think is no surprise. I don’t think that an exposed dropdown should hold so many items without trouble in UI. When you open a dropdown the composition starts I think that will block the mainThread to long that’s why everything is freezing. I don’t know your special case for doing that, but I would think which opportunities maybe better for this case
s

saket

08/10/2022, 7:19 PM
counter-argument: I don't think that developers should have to think about sampling dropdown items. It's difficult to come up with a number that'll be smooth on all devices. @K Merle wanna file a feature request for
ExposedDropdownMenu
to use a lazy list?