Introduce vibrateIfPossible into the utils package. This will check if the browser

has support for vibrating. This fixes a number of bugs for iOS safari & friends.
This commit is contained in:
Haze Booth
2023-08-24 12:02:22 -04:00
parent 6f02912d2e
commit 63d51e9119
12 changed files with 34 additions and 24 deletions

View File

@@ -12,7 +12,7 @@
import {cubicIn} from 'svelte/easing';
import { flip } from 'svelte/animate';
import { type ContainerLayout, type WidgetLayout, type IDragItem, type WritableLayoutStateStore } from "$lib/stores/layoutStates";
import { startDrag, stopDrag } from "$lib/utils"
import { startDrag, stopDrag, vibrateIfPossible } from "$lib/utils"
import type { Writable } from "svelte/store";
import { isHidden } from "$lib/widgets/utils";
import { handleContainerConsider, handleContainerFinalize } from "./utils";
@@ -62,7 +62,7 @@
}
function handleSelect() {
navigator.vibrate(20)
vibrateIfPossible(20)
}
function _startDrag(e: MouseEvent | TouchEvent) {