From 1c5a4d223ca796fd862f5d4c68fe8c3ee6a0e829 Mon Sep 17 00:00:00 2001 From: Roshan Varughese <40583749+Animeboynz@users.noreply.github.com> Date: Mon, 9 Sep 2024 00:24:15 +1200 Subject: [PATCH] Fix WheelPicker Manual Input --- .../presentation/core/components/WheelPicker.kt | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 c4cf6e471..6c68330a0 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 @@ -166,6 +166,18 @@ private fun WheelPicker( showManualInput = false } }, + onKeyboardAction = { + scope.launch { + items + .indexOfFirst { it.toString() == value.text } + .takeIf { it >= 0 } + ?.apply { + internalOnSelectionChanged(this) + lazyListState.scrollToItem(this) + } + showManualInput = false + } + }, state = value, lineLimits = TextFieldLineLimits.SingleLine, keyboardOptions = KeyboardOptions(