forked from Github/frigate
fix touch events (#11265)
This commit is contained in:
@@ -87,7 +87,7 @@ function useDraggableElement({
|
||||
const getClientYPosition = useCallback(
|
||||
(e: MouseEvent | TouchEvent) => {
|
||||
let clientY;
|
||||
if (e instanceof TouchEvent) {
|
||||
if ("TouchEvent" in window && e instanceof TouchEvent) {
|
||||
clientY = e.touches[0].clientY;
|
||||
} else if (e instanceof MouseEvent) {
|
||||
clientY = e.clientY;
|
||||
@@ -113,7 +113,7 @@ function useDraggableElement({
|
||||
setIsDragging(true);
|
||||
|
||||
let clientY;
|
||||
if (e.nativeEvent instanceof TouchEvent) {
|
||||
if ("TouchEvent" in window && e.nativeEvent instanceof TouchEvent) {
|
||||
clientY = e.nativeEvent.touches[0].clientY;
|
||||
} else if (e.nativeEvent instanceof MouseEvent) {
|
||||
clientY = e.nativeEvent.clientY;
|
||||
|
||||
Reference in New Issue
Block a user