fix: fixed swiping of a deal during dragging on mobile
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import React, { ReactNode, RefObject } from "react";
|
||||
import React, { ReactNode, RefObject, useMemo } from "react";
|
||||
import {
|
||||
DndContext,
|
||||
DragEndEvent,
|
||||
@ -75,6 +75,7 @@ const FunnelDnd = <
|
||||
}: Props<TContainer, TItem>) => {
|
||||
const sensors = useDndSensors();
|
||||
const isMobile = useIsMobile();
|
||||
const frequency = useMemo(() => (isMobile ? 1 : undefined), [isMobile]);
|
||||
|
||||
const renderContainers = () =>
|
||||
containers.map((container, index) => {
|
||||
@ -159,6 +160,11 @@ const FunnelDnd = <
|
||||
return (
|
||||
<DndContext
|
||||
sensors={sensors}
|
||||
measuring={{
|
||||
droppable: {
|
||||
frequency,
|
||||
},
|
||||
}}
|
||||
onDragStart={onDragStart}
|
||||
onDragOver={onDragOver}
|
||||
onDragEnd={onDragEnd}>
|
||||
|
||||
Reference in New Issue
Block a user