p

    Philip Blandford

    2 years ago
    If I try to specify the width of a TextField, it sets the editable section to that width, but centres it in a fixed-width container. Is this expected behaviour? It's certainly not what I expected...
    Column {
      TextField(value = "", onValueChange = { }, label = {}, modifier = Modifier.width(50.dp))
      TextField(value = "", onValueChange = { }, label = {}, modifier = Modifier.width(100.dp))
      TextField(value = "", onValueChange = { }, label = {}, modifier = Modifier.width(150.dp))
    
    }
    Zach Klippenstein (he/him) [MOD]

    Zach Klippenstein (he/him) [MOD]

    2 years ago
    You can specify the gravity for the children to change that centering behavior
    v

    Vinay Gaba

    2 years ago
    Although, there is some inconsistency across the composables when it comes to the default behavior.