π¬ A browser extension and desktop app that turns your clicks into step-by-step guides with annotated screenshots π
TypeScript browser-extensionchrome-extensiondocumentationfirefox-extensionguide-generatorlocal-firstmanifest-v3privacy-firstproductivityreactscreenshotstep-by-step-guidetutorialtypescriptworkflowwxt
import { useRef } from 'react';
import type { DragHandleProps } from '../types';
export function useCardDrag(dragHandleProps?: DragHandleProps) {
const pressedHandle = useRef(false);
return {
draggable: !!dragHandleProps,
onPointerDownCapture: (e: React.PointerEvent) => {
pressedHandle.current = !!(e.target as Element).closest('[data-drag-handle]');
},
onDragStart: (e: React.DragEvent) => {
if (!pressedHandle.current) {
e.preventDefault();
return;
}
dragHandleProps?.onDragStart(e);
},
};
}