Giving a Surface composable a fixed height through modifiers does not work. Is that an expected behaviour of the Surface composable or a bug?
m
Mihai Popa
01/17/2020, 2:34 PM
Can you show me where the Surface is used?
k
Klaas Kabini
01/17/2020, 2:45 PM
Copy code
@Composable
fun EditText() {
var model by +state { "" }
Column {
Surface(modifier = Spacing(16.dp) wraps Height(64.dp),
border = Border(Color.Black.copy(alpha = 0.25f), 1.dp)) {
TextField(modifier = ExpandedHeight, value = model,
onValueChange = {
model = it
},
textStyle = (+typography()).body1
)
}
}
}
@Mihai Popa here is the code snippet. The height modifier does not make any effect on the surface
m
Mihai Popa
01/17/2020, 4:26 PM
Thanks, I did some digging and this seems to be a bug in TextField, which does not respect the constraints coming from the modifier
Mihai Popa
01/17/2020, 4:26 PM
Could you please file a bug with this code snippet?
k
Klaas Kabini
01/17/2020, 4:27 PM
Okay, i will do so
Klaas Kabini
01/17/2020, 5:13 PM
@Mihai Popa you are right. I just did another test, the surface works with other components such as Buttons except the Textfield. I have filed this issue https://issuetracker.google.com/issues/147873046