Assigned
Status Update
Comments
ma...@google.com <ma...@google.com>
ks...@gmail.com <ks...@gmail.com> #2
UPD: Firstly I decided that keyborad text correction affects spanStyle
in entered annotatted string of TextField
, but looks like it's also can be caused by bugs at EditProcessor
or FinishComposingTextCommand
:
when control-flow goes into apply
method in EditProcessor
there is newState is created:
val newState = TextFieldValue(
annotatedString = mBuffer.toAnnotatedString(),
selection = TextRange(mBuffer.selectionStart, mBuffer.selectionEnd),
composition = if (mBuffer.hasComposition()) {
TextRange(mBuffer.compositionStart, mBuffer.compositionEnd)
} else {
null
}
)
and method toAnnotatedString()
clears spanStyle list :(
please fix this issue, cause I really need it, and I don't want come back to using xmls :(((
se...@google.com <se...@google.com>
be...@gmail.com <be...@gmail.com> #3
Do you have any updates on this? Thanks for any efforts.
ha...@google.com <ha...@google.com> #4
Multi-styled text editing is planned to be addressed with the new BasicTextField
overload that takes TextFieldState
.
Description
Android Studio Build:
Android Studio Arctic Fox | 2020.3.1 Patch 2
Build #AI-203.7717.56.2031.7678000, built on August 27, 2021
Runtime version: 11.0.10+0-b96-7249189 amd64
Kotlin version: 1.5.10
Steps to Reproduce:
1. Type text into TextField
2. Select substring and make it bold (via spanStyle)
3. Click on another place in entered text
4. TextField will underline word around cursor
4. onValueChange callback is invoked with latest TextFieldValue with empty spanStyle its annotationString