You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When using the iOS stock keyboard's voice dictation in a BasicTextField using TextFieldValue, the dictated text is cleared when voice dictation is disabled.
Affected platforms
iOS
Versions
Libraries:
Compose Multiplatform version: 1.6.11
Kotlin version: 2.0.0
OS version(s) (required for Desktop and iOS issues): iOS 17.5.1
OS architecture (x86 or arm64): N/A
Device (model or simulator for iOS issues): iPhone SE 2020, but reported on newer models as well
JDK (for desktop issues): N/A
To Reproduce
Steps to reproduce the behavior:
Create a BasicTextField using TextFieldValue e.g.
var textState by remember { mutableStateOf(TextFieldValue()) }
BasicTextField(
value = textState,
onValueChange = { textState = it },
)
Click on the voice dictation button on the stock iOS keyboard
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 onValueChangehere. 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
The text was updated successfully, but these errors were encountered: