Update MkPullToRefresh.vue
This commit is contained in:
@@ -139,6 +139,7 @@ async function closeContent() {
|
||||
}
|
||||
|
||||
function onPullRelease() {
|
||||
window.document.body.removeAttribute('inert');
|
||||
startScreenY = null;
|
||||
if (isPulledEnough.value) {
|
||||
isPulledEnough.value = false;
|
||||
@@ -181,6 +182,11 @@ function moving(event: MouseEvent | TouchEvent) {
|
||||
const moveHeight = moveScreenY - startScreenY!;
|
||||
pullDistance.value = Math.min(Math.max(moveHeight, 0), MAX_PULL_DISTANCE);
|
||||
|
||||
// マウスでのpull時、画面上のテキスト選択が発生して画面がスクロールされたりするのを防ぐ
|
||||
if (pullDistance.value > 3) { // ある程度遊びを持たせないと通常のクリックでも発火しクリックできなくなる
|
||||
window.document.body.setAttribute('inert', 'true');
|
||||
}
|
||||
|
||||
isPulledEnough.value = pullDistance.value >= FIRE_THRESHOLD;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user