https://kotlinlang.org logo
#compose
Title
# compose
k

Kisses

03/22/2024, 8:19 AM
Can someone help me? I'm having a problem with the width of DropDownMenuItem, it doesn't match the OutlinedTextField width even I set the modifier to .fillMaxWidth. The UI doesn't look good.
s

Stylianos Gakis

03/22/2024, 8:25 AM
I could be wrong, but you might be dealing with the fact that both of those two components come from inside m3 so they may have some built-in paddings and whatnot inside that are not editable but don’t really fit your use case. Without looking at the screenshot it’s gonna be hard to know for sure. With that said, I know this https://saket.github.io/cascade/compose/ exists which is like the dropdown but does not impose any default spacings to the children. It might be what you need.
k

Kisses

03/22/2024, 8:33 AM
@Stylianos Gakis This is what it looks like,
s

Stylianos Gakis

03/22/2024, 8:35 AM
Yeah, did you check if that component has a max width set internally?
k

Kisses

03/22/2024, 8:44 AM
@Stylianos Gakis I'm not sure how, but I set the modifier to fill max width. Sorry I'm really new in development using compose. This is my code.
s

Stylianos Gakis

03/22/2024, 8:53 AM
What does exposedDropdownSize do?
k

Kisses

03/22/2024, 8:58 AM
@Stylianos Gakis I saw it in here, but it is also not working as of testing. https://issuetracker.google.com/issues/205589613
s

Stylianos Gakis

03/22/2024, 9:02 AM
They say it's fixed in the alphas. Try to use that to see if their fix works for you too.
k

Kisses

03/22/2024, 9:14 AM
@Stylianos Gakis is that safe to use? I'm currently using this versions. compose = "1.6.0" compose-compiler = "1.5.4" compose-material3 = "1.2.0-rc01"
s

Stylianos Gakis

03/22/2024, 10:10 AM
Looks like the issue mentions
material3:1.3.0-alpha03
as the version that has this fixed. If you want to see if that will work for you, try that one instead.
👍 1