francisco
08/31/2023, 9:42 PMOutlinedTextField
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:
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 suffixfrancisco
08/31/2023, 9:45 PMOutlinedTextInput
composablefrancisco
08/31/2023, 9:46 PMfrancisco
08/31/2023, 9:50 PMdewildte
08/31/2023, 10:05 PM48.dp
.
That makes the padding intended and as per design.dewildte
08/31/2023, 10:07 PM24.dp
but it probably lives in a box of at least 48.dp
francisco
08/31/2023, 10:07 PMfrancisco
08/31/2023, 10:07 PMfrancisco
08/31/2023, 10:07 PMdewildte
08/31/2023, 10:12 PMdewildte
08/31/2023, 10:12 PMdewildte
08/31/2023, 10:12 PMfrancisco
08/31/2023, 10:19 PMdewildte
09/01/2023, 3:59 PMdewildte
09/01/2023, 4:00 PM