diff --git a/packages/ui/src/components/blocks/status-bar.tsx b/packages/ui/src/components/blocks/status-bar.tsx index 6f7fd9cf..2dc26d46 100644 --- a/packages/ui/src/components/blocks/status-bar.tsx +++ b/packages/ui/src/components/blocks/status-bar.tsx @@ -147,11 +147,16 @@ function useStatusBar({ dataLength, isTouch }: UseStatusBarProps) { } }, []); + const interactionTypeRef = useRef(null); + useEffect(() => { + interactionTypeRef.current = interactionType; + }, [interactionType]); + const handleClick = useCallback( (index: number) => { clearHoverTimeout(); setActiveIndex((prev) => { - if (prev === index) { + if (prev === index && interactionTypeRef.current === "pin") { setInteractionType(null); return null; }