diff --git a/presentation-core/src/main/java/tachiyomi/presentation/core/components/WheelPicker.kt b/presentation-core/src/main/java/tachiyomi/presentation/core/components/WheelPicker.kt index c4cf6e471a..8187dd4ceb 100644 --- a/presentation-core/src/main/java/tachiyomi/presentation/core/components/WheelPicker.kt +++ b/presentation-core/src/main/java/tachiyomi/presentation/core/components/WheelPicker.kt @@ -149,23 +149,25 @@ private fun WheelPicker( } val scope = rememberCoroutineScope() + val processManualInput: () -> Unit = { + scope.launch { + items + .indexOfFirst { it.toString() == value.text } + .takeIf { it >= 0 } + ?.apply { + internalOnSelectionChanged(this) + lazyListState.scrollToItem(this) + } + showManualInput = false + } + } + BasicTextField( modifier = Modifier .align(Alignment.Center) .showSoftKeyboard(true) - .clearFocusOnSoftKeyboardHide { - scope.launch { - items - .indexOfFirst { it.toString() == value.text } - .takeIf { it >= 0 } - ?.apply { - internalOnSelectionChanged(this) - lazyListState.scrollToItem(this) - } - - showManualInput = false - } - }, + .clearFocusOnSoftKeyboardHide(processManualInput), + onKeyboardAction = { processManualInput() }, state = value, lineLimits = TextFieldLineLimits.SingleLine, keyboardOptions = KeyboardOptions(