Chris Sinco [G]
09/07/2023, 2:18 AMTextField
in Material2 (haven't tested Material3) in 1.4.1, on recomposition when changing themes and used in a Surface
. Code snippet below should repro the crash in browser:
var useDarkTheme by remember { mutableStateOf(false) }
var text by remember { mutableStateOf("Hello") }
MaterialTheme(
colors = if (useDarkTheme) darkColors() else lightColors()
) {
Surface {
TextField(
value = text,
onValueChange = { text = it },
label = { Text("Label") }
)
Button(onClick = { useDarkTheme = !useDarkTheme }) {
Text("Toggle theme")
}
}
}
It works fine if you don't change colors on the fly, which is odd. Also this happens with BasicTextField
so it's likely a deeper issue than the Material layer. Is this a known issue?Chris Sinco [G]
09/07/2023, 2:22 AMMitchell Syer
09/07/2023, 3:13 AMtoLanguageTag
was implemented in Compose 1.5, before that it threw the not implemented exceptionOleksandr Karpovich [JB]
09/07/2023, 2:20 PM