Fixed
Status Update
Comments
si...@google.com <si...@google.com> #2
Any news about this issue?
ch...@gmail.com <ch...@gmail.com> #3
Any news about this issue?
si...@google.com <si...@google.com> #4
I have the same issue.
Jetpack Compose version: 1.0.2
My code:
@ExperimentalComposeUiApi
@Composable
fun Code(modifier: Modifier = Modifier, onCodeInputted: (String) -> Unit = {}) {
val passcodeLength = 6
val codeArray = remember {
Array(passcodeLength) {
mutableStateOf(TextFieldValue(text = ""))
}
}
val focusRequesters = remember {
(0 until passcodeLength).map { FocusRequester() }
}
Row(modifier = modifier) {
repeat(passcodeLength) { textFieldIndex ->
OutlinedTextField(
modifier = Modifier
.weight(1f)
.onPreviewKeyEvent {
if (it.type == KeyEventType.KeyDown && it.key == Key.Backspace &&
textFieldIndex != 0 && codeArray[textFieldIndex].value.text.isEmpty()
) {
codeArray[textFieldIndex - 1].value =
codeArray[textFieldIndex - 1].value.copy(text = "")
focusRequesters[textFieldIndex - 1].requestFocus()
}
false
}
.focusRequester(focusRequesters[textFieldIndex]),
value = codeArray[textFieldIndex].value,
textStyle = LocalTextStyle.current.copy(
textAlign = TextAlign.Center
),
singleLine = true,
keyboardOptions = KeyboardOptions.Default.copy(
keyboardType = KeyboardType.Number,
imeAction = ImeAction.Next
),
onValueChange = { newTextFieldValue ->
val newString = newTextFieldValue.text
if (newString.isDigitsOnly() && codeArray[textFieldIndex].value.text != newString) {
codeArray[textFieldIndex].value =
if (newString.length > 1) {
newTextFieldValue.copy(text = newString[0].toString())
} else newTextFieldValue
if (newString != "") {
val nextEmpty =
codeArray.indices.firstOrNull { codeArray[it].value.text == "" }
if (nextEmpty != null) {
focusRequesters[nextEmpty].requestFocus()
} else {
onCodeInputted(codeArray.joinToString(separator = "") { it.value.text })
}
}
}
}
)
if (textFieldIndex != passcodeLength - 1) {
Spacer(Modifier.width(10.dp))
}
}
}
}
co...@protonmail.com <co...@protonmail.com> #5
Any info about this issue? :)
si...@google.com <si...@google.com> #6
Does any hacky workaround exists?
cm...@gmail.com <cm...@gmail.com> #7
Still nothing?
ha...@google.com <ha...@google.com> #8
any updated for this issue? or any work around?
si...@google.com <si...@google.com> #9
Same issue
se...@google.com <se...@google.com>
ap...@google.com <ap...@google.com> #10
Same issue
ap...@google.com <ap...@google.com> #11
Same issue
ap...@google.com <ap...@google.com> #12
Same issue
ap...@google.com <ap...@google.com> #13
I have created an article on a possible workaround, hope it helps.
https://chetangupta.net/keyboard-switch-bug/
ap...@google.com <ap...@google.com> #14
This hack only viable for pin/otp stuff. It won't fix an issue when you have a regular form
ap...@google.com <ap...@google.com> #15
Faced with the same issue.
Hope google will pay its attention on this bug someday :D
Hope google will pay its attention on this bug someday :D
ap...@google.com <ap...@google.com> #16
Also facing the same issue
ap...@google.com <ap...@google.com> #17
Same Issue
ap...@google.com <ap...@google.com> #18
That flickers for me too
ap...@google.com <ap...@google.com> #19
This issue still exists on version 1.05. We actually have users complaining about it in the reviews....
ap...@google.com <ap...@google.com> #20
Probably the same bug, but I've noticed just using the backspace button in a single text field can also cause this to happen, it's like the keyboard/IME is being reloaded with every backspace!
Video attached. Seems like a pretty big issue, might delay are move to Compose over this.
Video attached. Seems like a pretty big issue, might delay are move to Compose over this.
ap...@google.com <ap...@google.com> #21
Any solution. To this issues??
Perhaps a walk around ?
Perhaps a walk around ?
ap...@google.com <ap...@google.com> #22
Guys any update on this ticket?
ap...@google.com <ap...@google.com> #23
same issue here
ap...@google.com <ap...@google.com> #24
same issue
ap...@google.com <ap...@google.com> #25
same issue
ap...@google.com <ap...@google.com> #26
same issue
ni...@google.com <ni...@google.com> #28
Probably the same bug, but I've noticed just using the backspace button in a single text field can also cause this to happen, it's like the keyboard/IME is being reloaded with every backspace!
Can you share repro code? I can definitely reproduced the issue with the code in the original issue description, but I haven't been able to reproduce with just backspace in a single field.
Description
Currently we can not use downloadable fonts in Compose. It would be great if we could use them to reduce APK size.