mirror of
https://github.com/mihonapp/mihon.git
synced 2024-12-26 19:08:25 +01:00
Fix WheelPicker Manual Input (#1209)
* Fix WheelPicker Manual Input * Lambda * inline * Update WheelPicker.kt --------- Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
This commit is contained in:
parent
223af5508f
commit
339dc33f58
@ -149,11 +149,7 @@ private fun <T> WheelPicker(
|
|||||||
}
|
}
|
||||||
|
|
||||||
val scope = rememberCoroutineScope()
|
val scope = rememberCoroutineScope()
|
||||||
BasicTextField(
|
val processManualInput: () -> Unit = {
|
||||||
modifier = Modifier
|
|
||||||
.align(Alignment.Center)
|
|
||||||
.showSoftKeyboard(true)
|
|
||||||
.clearFocusOnSoftKeyboardHide {
|
|
||||||
scope.launch {
|
scope.launch {
|
||||||
items
|
items
|
||||||
.indexOfFirst { it.toString() == value.text }
|
.indexOfFirst { it.toString() == value.text }
|
||||||
@ -162,10 +158,16 @@ private fun <T> WheelPicker(
|
|||||||
internalOnSelectionChanged(this)
|
internalOnSelectionChanged(this)
|
||||||
lazyListState.scrollToItem(this)
|
lazyListState.scrollToItem(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
showManualInput = false
|
showManualInput = false
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
|
|
||||||
|
BasicTextField(
|
||||||
|
modifier = Modifier
|
||||||
|
.align(Alignment.Center)
|
||||||
|
.showSoftKeyboard(true)
|
||||||
|
.clearFocusOnSoftKeyboardHide(processManualInput),
|
||||||
|
onKeyboardAction = { processManualInput() },
|
||||||
state = value,
|
state = value,
|
||||||
lineLimits = TextFieldLineLimits.SingleLine,
|
lineLimits = TextFieldLineLimits.SingleLine,
|
||||||
keyboardOptions = KeyboardOptions(
|
keyboardOptions = KeyboardOptions(
|
||||||
|
Loading…
Reference in New Issue
Block a user