diff --git a/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/components/PinEntryTextField.kt b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/components/PinEntryTextField.kt index bbdd5ce038..28e005fd1d 100644 --- a/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/components/PinEntryTextField.kt +++ b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/components/PinEntryTextField.kt @@ -83,11 +83,12 @@ private fun PinEntryRow( horizontalArrangement = Arrangement.spacedBy(8.dp, alignment = Alignment.CenterHorizontally), verticalArrangement = Arrangement.spacedBy(8.dp), ) { + val focusedIndex = pinEntry.digits.indexOfFirst { it is PinDigit.Empty } pinEntry.digits.forEachIndexed { index, digit -> PinDigitView( digit = digit, isSecured = isSecured, - isFocused = isFocused && index == pinEntry.digits.indexOfFirst { it is PinDigit.Empty } + isFocused = isFocused && index == focusedIndex ) } }