gregmcgowan
09/10/2024, 3:12 PMgregmcgowan
09/11/2024, 8:02 AM@Composable
fun CustomTexField() {
Column(modifier = Modifier) {
var value by remember { mutableStateOf("") }
BasicTextField2(
value = value,
onValueChange = { value = it },
decorator = {
TextFieldDecorator(textFieldContent = it,)
})
}
}
@Composable
private fun TextFieldDecorator(
modifier: Modifier = Modifier,
textFieldContent: @Composable () -> Unit,
) {
Column(modifier = modifier) {
Text(text = "Favourite Airline")
Text(text = "You must have travelled with them in the last five years")
Row {
textFieldContent()
}
}
}
Adrian Landborn
09/16/2024, 11:47 AMAdrian Landborn
09/16/2024, 11:48 AMmergeDescendants =true
to handle this?gregmcgowan
10/02/2024, 2:10 PMAdrian Landborn
10/02/2024, 3:11 PMBasicTextField2
nor BasicTextField
resolves properlyAdrian Landborn
10/02/2024, 3:11 PMgregmcgowan
10/02/2024, 3:25 PM@Composable
fun CustomTexField() {
Column(modifier = Modifier) {
val state = rememberTextFieldState()
BasicTextField(
state = state,
decorator = {
TextFieldDecorator(textFieldContent = it,)
})
}
}
@Composable
private fun TextFieldDecorator(
modifier: Modifier = Modifier,
textFieldContent: @Composable () -> Unit,
) {
Column(modifier = modifier) {
Text(text = "Favourite Airline")
Text(text = "You must have travelled with them in the last five years")
Row {
textFieldContent()
}
}
}
gregmcgowan
10/02/2024, 3:25 PMAdrian Landborn
10/02/2024, 3:25 PMdecorator
with decorationBox
But anyhow I do think the whole purpose of decorator is to have that label as a descriptor for the Editbox. We have a similar setup in our code and “Edittext” is also read first. I do think your designer might have it wrong and may be unfamiliar with how androids Talkback is supposed to work? If you look into “advanced settings” for Talkback a user can set their preferred order to be consistent throughtout the whole phone UI.gregmcgowan
10/02/2024, 3:31 PM