Skip to content

Commit

Permalink
improve search bar unfocusing
Browse files Browse the repository at this point in the history
  • Loading branch information
MM2-0 committed Apr 23, 2023
1 parent 498af47 commit 87769ea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 87769ea

Please sign in to comment.