Consider the `FancyTextField`:
@Composable
fun FancyTextField(value: String, onValueChange: (String) -> Unit, modifier: Modifier = Modifier) {
Column(modifier) {
TextField(value, onValueChange)
Text("fancy!")
}
}
While looking innocent, this code breaks the passed modifiers. If I pass for example
Modifier.fillMaxWidth()
, then only the
Column
will have expanded width, and the
TextField
will stay the same size, meaning that
fillMaxWidth
will not make
FancyTextField
fill max width (in practice). Obviously passing a modifier to
TextFIeld
(instead or in addition) won't work well.
So how should
FancyTextField
be declared in such a way that modifiers work as expected?