Hey everyone, I have a question regarding the mate...
# compose
f
Hey everyone, I have a question regarding the material3
OutlinedTextField
According to the M3 spec, an optional leading/trailing icon slot of size 24.dp exists. When I implement the
OutlinedTextField
and pass in an icon, I see the slot gets hardcoded to be
48x48.dp
based on this property:
Copy code
internal val IconDefaultSizeModifier = Modifier.defaultMinSize(48.dp, 48.dp)
in
TextFieldImpl.kt
This is causing some bad “padding” between a trailing/leading icon and prefix/suffix. is this a bug on compose implementation? shouldn’t it be 24x24? Here is what my text input looks like. notice how “far” away the traling icon is from suffix
my
OutlinedTextInput
composable
What I am trying to achieve:
d
I would assert this is not a bug because the leading and trailing icons are intended to support click-ability. Clickable icon buttons are supposed to have a touch target of at least
48.dp
. That makes the padding intended and as per design.
The icon itself is
24.dp
but it probably lives in a box of at least
48.dp
f
image.png
ok yeah that makes more sense
thanks @dewildte
d
Screenshot 2023-08-31 at 18.11.00.png
Screenshot 2023-08-31 at 18.12.19.png
And there it is.
f
👀 what theme are you using? it’s beautiful
😄 1
d
I am using the Material Theme plugin with the Night Owl theme applied.
It has a Light Owl theme for the day time too.