Open garrison-henkle opened 4 days ago
I played around with the debugger / print statements for a bit this afternoon. To reproduce in the compose-multiplatform-core
repo, I added the following to androidx.compose.mpp.demo.textfield.android.TextFieldValueDemo
:
item {
TagLine("TextFieldValue overload")
var state by remember { mutableStateOf(TextFieldValue()) }
BasicTextField(
value = state,
onValueChange = { state = it },
textStyle = TextStyle(fontSize = fontSize8),
modifier = demoTextFieldModifiers
)
}
So far, the issue seems be somewhere afteronValueChangeOriginal
is called in CoreTextField
's onValueChange
here. It is called with the correct TextFieldValue
containing the dictated text, but the callback in the BasicTextField
that I'm using receives what looks like a brand new empty TextFieldValue
instance instead.
There is a currentRecomposeScope.invalidate()
that is called immediately after the onValueChangeOriginal
call, so I wonder if that is breaking something.
Describe the bug When using the iOS stock keyboard's voice dictation in a
BasicTextField
usingTextFieldValue
, the dictated text is cleared when voice dictation is disabled.Affected platforms
Versions
To Reproduce Steps to reproduce the behavior:
BasicTextField
usingTextFieldValue
e.g.Repo that reproduces the issue on my device: https://github.com/garrison-henkle/composeMultiplatformVoiceDictationBug
Expected behavior The text does not disappear when dictation ends
Screenshots https://github.com/JetBrains/compose-multiplatform/assets/70973354/d4997920-0a77-479e-a5a9-26b7be7259a1
Additional context