improve search bar unfocusing
This commit is contained in:
parent
498af47265
commit
87769ead41
@ -299,7 +299,7 @@ fun PagerScaffold(
|
|||||||
object : NestedScrollConnection {
|
object : NestedScrollConnection {
|
||||||
override fun onPreScroll(available: Offset, source: NestedScrollSource): Offset {
|
override fun onPreScroll(available: Offset, source: NestedScrollSource): Offset {
|
||||||
if (source == NestedScrollSource.Drag && available.y.absoluteValue > available.x.absoluteValue * 2) {
|
if (source == NestedScrollSource.Drag && available.y.absoluteValue > available.x.absoluteValue * 2) {
|
||||||
keyboardController?.hide()
|
viewModel.setSearchbarFocus(false)
|
||||||
searchVM.bestMatch.value = null
|
searchVM.bestMatch.value = null
|
||||||
}
|
}
|
||||||
return super.onPreScroll(available, source)
|
return super.onPreScroll(available, source)
|
||||||
|
|||||||
@ -277,7 +277,7 @@ fun PullDownScaffold(
|
|||||||
override fun onPreScroll(available: Offset, source: NestedScrollSource): Offset {
|
override fun onPreScroll(available: Offset, source: NestedScrollSource): Offset {
|
||||||
if (isWidgetEditMode || source != NestedScrollSource.Drag) return Offset.Zero
|
if (isWidgetEditMode || source != NestedScrollSource.Drag) return Offset.Zero
|
||||||
if (available.y.absoluteValue > available.x.absoluteValue * 2) {
|
if (available.y.absoluteValue > available.x.absoluteValue * 2) {
|
||||||
keyboardController?.hide()
|
viewModel.setSearchbarFocus(false)
|
||||||
searchVM.bestMatch.value = null
|
searchVM.bestMatch.value = null
|
||||||
}
|
}
|
||||||
val canPullDown = if (isSearchOpen) {
|
val canPullDown = if (isSearchOpen) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user