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