Since there's not a compose exposed dropdown menu ...
# compose
d
Since there's not a compose exposed dropdown menu yet I built one myself (there's a WIP patch somewhere, but it uses a lot of compose internals so it's hard to copy). I'm happy with how it looks, but not with the complexity of the code. Is there a way to avoid needing subcomposeLayout but get the same result? Thanks! https://gist.github.com/danielzfranklin/a54260971aa51b2e2c4140c741f7650b
c
I will be sure to use this 😄 Exposed dropdown is one of my biggest wants from compose material lib.
👍 2
z
I would expect this sort of component to use Popup, which is designed to position itself relative to some other content. I think it might let you avoid the SCL? https://developer.android.com/reference/kotlin/androidx/compose/ui/window/package-summary
d
Thanks for introducing me to Popup @Zach Klippenstein (he/him) [MOD]. Per the docs DropdownMenu should behave similarly when it comes to layout. The reason I'm using SCL is to have the popup be the exact same width as the field. If I do nothing and just render both the width of the popup matches the width of the text, if I set the popup to Modifier.fillMaxSize it's about 20% bigger than the Box holding it and the field.
z
Might be worth filing a feature request for that
👍 1
d
Once they build an official one this'll be a pretty esoteric use case. And I'm 0/3 on feature requests people suggested I make here, so I don't think I'll bother.