mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-07-26 03:14:58 +02:00
fix(frontend): Lightbox上で強くスワイプしたときに一時的に画面が操作不能になる問題を修正 (#17785)
* fix(frontend): Lightbox上で強くスワイプしたときに一時的に画面が操作不能になる問題を修正 * fix * update comment
This commit is contained in:
@@ -16,7 +16,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
@pointerup.passive="onPointerup"
|
||||
@pointercancel.passive="cancelPointerGesture"
|
||||
@touchstart.passive="onTouchstart"
|
||||
@touchmove.passive="onTouchmove"
|
||||
@touchmove="onTouchmove"
|
||||
@touchcancel.passive="cancelPointerGesture"
|
||||
@contextmenu="cancelPointerGesture"
|
||||
@wheel="onWheel"
|
||||
@@ -721,6 +721,13 @@ function onTouchstart(ev: TouchEvent) {
|
||||
|
||||
function onTouchmove(ev: TouchEvent) {
|
||||
doubleTapDetector.onTouchmove(ev);
|
||||
|
||||
// スワイプ操作中は、ブラウザがタッチを慣性スクロールとして認識するのを防ぐためにpreventDefaultする必要がある
|
||||
// touch-action: noneが指定されているが、それだけではブラウザによっては慣性スクロールが発生した扱いになり、
|
||||
// その後のタップが慣性スクロールを止めるためのタップという扱いで握りつぶされてしまうことがあるので必要
|
||||
if (isVerticalSwiping || isHorizontalSwiping || isZooming.value || pointerEventCache.size > 1) {
|
||||
ev.preventDefault();
|
||||
}
|
||||
}
|
||||
|
||||
//#region inertia
|
||||
|
||||
Reference in New Issue
Block a user