Unhighlight highlightes search result on scroll

This commit is contained in:
MM20 2023-02-20 14:18:06 +01:00
parent 336be61521
commit 5c44276b26
No known key found for this signature in database
GPG Key ID: 0B61A8F2DEAFA389
2 changed files with 2 additions and 0 deletions

View File

@ -284,6 +284,7 @@ fun PagerScaffold(
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() keyboardController?.hide()
searchVM.bestMatch.value = null
} }
return super.onPreScroll(available, source) return super.onPreScroll(available, source)
} }

View File

@ -279,6 +279,7 @@ fun PullDownScaffold(
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() keyboardController?.hide()
searchVM.bestMatch.value = null
} }
val canPullDown = if (isSearchOpen) { val canPullDown = if (isSearchOpen) {
isSearchAtTop isSearchAtTop