improve search bar unfocusing

This commit is contained in:
MM20 2023-04-23 20:57:22 +02:00
parent 498af47265
commit 87769ead41
No known key found for this signature in database
GPG Key ID: 0B61A8F2DEAFA389
2 changed files with 2 additions and 2 deletions

View File

@ -299,7 +299,7 @@ fun PagerScaffold(
object : NestedScrollConnection {
override fun onPreScroll(available: Offset, source: NestedScrollSource): Offset {
if (source == NestedScrollSource.Drag && available.y.absoluteValue > available.x.absoluteValue * 2) {
keyboardController?.hide()
viewModel.setSearchbarFocus(false)
searchVM.bestMatch.value = null
}
return super.onPreScroll(available, source)

View File

@ -277,7 +277,7 @@ fun PullDownScaffold(
override fun onPreScroll(available: Offset, source: NestedScrollSource): Offset {
if (isWidgetEditMode || source != NestedScrollSource.Drag) return Offset.Zero
if (available.y.absoluteValue > available.x.absoluteValue * 2) {
keyboardController?.hide()
viewModel.setSearchbarFocus(false)
searchVM.bestMatch.value = null
}
val canPullDown = if (isSearchOpen) {