diff --git a/web/src/components/ArrangePhase.tsx b/web/src/components/ArrangePhase.tsx index 56cca4e..23b2e88 100644 --- a/web/src/components/ArrangePhase.tsx +++ b/web/src/components/ArrangePhase.tsx @@ -16,6 +16,7 @@ interface Props { export function ArrangePhase({ view, you, send }: Props) { const [order, setOrder] = useState(you.deck ?? []) const dragIndex = useRef(null) + const [dragging, setDragging] = useState(false) const locked = you.ready // Resync only if the deck's actual contents changed — every broadcast @@ -100,7 +101,10 @@ export function ArrangePhase({ view, you, send }: Props) { key={c.id} className="arrange-card" draggable - onDragStart={() => (dragIndex.current = i)} + onDragStart={() => { + dragIndex.current = i + setDragging(true) + }} onDragOver={(e) => { e.preventDefault() if (dragIndex.current !== null && dragIndex.current !== i) { @@ -108,9 +112,12 @@ export function ArrangePhase({ view, you, send }: Props) { dragIndex.current = i } }} - onDragEnd={() => (dragIndex.current = null)} + onDragEnd={() => { + dragIndex.current = null + setDragging(false) + }} > - +