diff options
| author | かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> | 2024-02-07 20:02:29 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-07 20:02:29 +0900 |
| commit | 155896a851f2a1060454ff614b5fecde4a8dd016 (patch) | |
| tree | 5c435d0a23537f2d51a079b95ef89e4f61a27901 /packages/frontend/src/components/MkPullToRefresh.vue | |
| parent | 正しい 2024.2.0-beta.10 改版手順? (#13173) (diff) | |
| download | sharkey-155896a851f2a1060454ff614b5fecde4a8dd016.tar.gz sharkey-155896a851f2a1060454ff614b5fecde4a8dd016.tar.bz2 sharkey-155896a851f2a1060454ff614b5fecde4a8dd016.zip | |
enhance(frontend/HorizontalSwipe): 操作性の改善 (#13038)
* Update swipe thresholds and touch-action
* スワイプ中にPullToRefreshが反応しないように
* 横スワイプに関与する可能性のある要素がある場合はスワイプを発火しないように
* update threshold
* isSwipingを外部化
* rename
---------
Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
Diffstat (limited to 'packages/frontend/src/components/MkPullToRefresh.vue')
| -rw-r--r-- | packages/frontend/src/components/MkPullToRefresh.vue | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/packages/frontend/src/components/MkPullToRefresh.vue b/packages/frontend/src/components/MkPullToRefresh.vue index 54ef117d77..e730d63afe 100644 --- a/packages/frontend/src/components/MkPullToRefresh.vue +++ b/packages/frontend/src/components/MkPullToRefresh.vue @@ -26,6 +26,7 @@ SPDX-License-Identifier: AGPL-3.0-only import { onMounted, onUnmounted, ref, shallowRef } from 'vue'; import { i18n } from '@/i18n.js'; import { getScrollContainer } from '@/scripts/scroll.js'; +import { isHorizontalSwipeSwiping } from '@/scripts/touch.js'; const SCROLL_STOP = 10; const MAX_PULL_DISTANCE = Infinity; @@ -129,7 +130,7 @@ function moveEnd() { function moving(event: TouchEvent | PointerEvent) { if (!isPullStart.value || isRefreshing.value || disabled) return; - if ((scrollEl?.scrollTop ?? 0) > (supportPointerDesktop ? SCROLL_STOP : SCROLL_STOP + pullDistance.value)) { + if ((scrollEl?.scrollTop ?? 0) > (supportPointerDesktop ? SCROLL_STOP : SCROLL_STOP + pullDistance.value) || isHorizontalSwipeSwiping.value) { pullDistance.value = 0; isPullEnd.value = false; moveEnd(); @@ -148,6 +149,10 @@ function moving(event: TouchEvent | PointerEvent) { if (event.cancelable) event.preventDefault(); } + if (pullDistance.value > SCROLL_STOP) { + event.stopPropagation(); + } + isPullEnd.value = pullDistance.value >= FIRE_THRESHOLD; } |