Fixed
Status Update
Comments
pa...@google.com <pa...@google.com>
je...@google.com <je...@google.com> #2
Any news about this issue?
an...@google.com <an...@google.com> #3
Any news about this issue?
ra...@google.com <ra...@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))
}
}
}
}
je...@google.com <je...@google.com> #5
Any info about this issue? :)
an...@google.com <an...@google.com> #6
Does any hacky workaround exists?
ra...@google.com <ra...@google.com> #7
Still nothing?
je...@google.com <je...@google.com> #8
any updated for this issue? or any work around?
an...@google.com <an...@google.com> #11
Same issue
an...@google.com <an...@google.com>
rh...@gmail.com <rh...@gmail.com> #12
Same issue
an...@google.com <an...@google.com> #13
I have created an article on a possible workaround, hope it helps.
https://chetangupta.net/keyboard-switch-bug/
ae...@google.com <ae...@google.com> #14
This hack only viable for pin/otp stuff. It won't fix an issue when you have a regular form
ks...@gmail.com <ks...@gmail.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
me...@thomaskeller.biz <me...@thomaskeller.biz> #16
Also facing the same issue
ks...@gmail.com <ks...@gmail.com> #17
Same Issue
ap...@google.com <ap...@google.com> #18
That flickers for me too
an...@team.bumble.com <an...@team.bumble.com> #19
This issue still exists on version 1.05. We actually have users complaining about it in the reviews....
an...@google.com <an...@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 ?
be...@gmail.com <be...@gmail.com> #22
Guys any update on this ticket?
an...@google.com <an...@google.com> #23
same issue here
na...@google.com <na...@google.com> #24
same issue
Description
Initially this bug was only about allowing to assert that node is not visible for any reason In my use case I don't care for what reason the node is not displayed. Either it is because the node is not composed at all, or it was composed, but wasn't placed. This behaviour in LazyColumn is not guaranteed as prefetching can decide to precompose an item in advance. But currently we have
Aside from that we should have a solid strategy on how we work with deactivated items(the ones from lazy list reuse pool):