Open b-camphart opened 2 years ago
Additional notes:
Additionally, this applies to the BasicText component too. If you run the following test:
@Composable
fun TextFieldTest() {
val value = AnnotatedString(
"abcd", spanStyles = listOf(
AnnotatedString.Range(SpanStyle(fontWeight = FontWeight.Bold), 1, 2)
)
)
SelectionContainer {
BasicText(text = value)
}
}
fun main() {
singleWindowApplication {
TextFieldTest()
}
}
You will be unable to select the bolded text and, if you try, the selection no longer responds appropriately.
Maybe related to this compose issue: https://issuetracker.google.com/issues/135556699
Summary
When using a
BasicTextField
, if the suppliedAnnotatedString
contains aSpanStyle
that does not cover the entire text and theTextFieldValue
has a selection that starts within theSpanStyle
range and ends outside it, the application stops rendering.Code to reproduce
Result
The application opens and the window can still be moved, but the window is black. If this is done after the application has been running, all future rendering will stop, but composition logic is still being performed.
Environment