The Open Source DocuSign Alternative.
TypeScript digital-signaturedocument-signingdocusign-alternativee-signatureesignesignaturenext-authnextjsopen-sourcepades-standardpdfpdf-signpdf-signaturepostgresqlprismaself-hostedsigningtypescript
fix: enable dragging fields (#565)
Udit Takkar352e4f81fde4
diff --git a/packages/ui/primitives/document-flow/add-fields.tsx b/packages/ui/primitives/document-flow/add-fields.tsxindex ea7bac2cb..f662dca8b 100644--- a/packages/ui/primitives/document-flow/add-fields.tsx+++ b/packages/ui/primitives/document-flow/add-fields.tsx@@ -246,12 +246,12 @@ export const AddFieldsFormPartial = ({useEffect(() => {if (selectedField) {window.addEventListener('mousemove', onMouseMove);- window.addEventListener('click', onMouseClick);+ window.addEventListener('mouseup', onMouseClick);}return () => {window.removeEventListener('mousemove', onMouseMove);- window.removeEventListener('click', onMouseClick);+ window.removeEventListener('mouseup', onMouseClick);};}, [onMouseClick, onMouseMove, selectedField]);@@ -417,7 +417,7 @@ export const AddFieldsFormPartial = ({type="button"className="group h-full w-full"disabled={!selectedSigner || selectedSigner?.sendStatus === SendStatus.SENT}- onClick={(e) => e.stopPropagation()}+ onClick={() => setSelectedField(FieldType.SIGNATURE)}onMouseDown={() => setSelectedField(FieldType.SIGNATURE)}data-selected={selectedField === FieldType.SIGNATURE ? true : undefined}>@@ -441,7 +441,7 @@ export const AddFieldsFormPartial = ({type="button"className="group h-full w-full"disabled={!selectedSigner || selectedSigner?.sendStatus === SendStatus.SENT}- onClick={(e) => e.stopPropagation()}+ onClick={() => setSelectedField(FieldType.EMAIL)}onMouseDown={() => setSelectedField(FieldType.EMAIL)}data-selected={selectedField === FieldType.EMAIL ? true : undefined}>@@ -464,7 +464,7 @@ export const AddFieldsFormPartial = ({type="button"className="group h-full w-full"disabled={!selectedSigner || selectedSigner?.sendStatus === SendStatus.SENT}- onClick={(e) => e.stopPropagation()}+ onClick={() => setSelectedField(FieldType.NAME)}onMouseDown={() => setSelectedField(FieldType.NAME)}data-selected={selectedField === FieldType.NAME ? true : undefined}>@@ -487,7 +487,7 @@ export const AddFieldsFormPartial = ({type="button"className="group h-full w-full"disabled={!selectedSigner || selectedSigner?.sendStatus === SendStatus.SENT}- onClick={(e) => e.stopPropagation()}+ onClick={() => setSelectedField(FieldType.DATE)}onMouseDown={() => setSelectedField(FieldType.DATE)}data-selected={selectedField === FieldType.DATE ? true : undefined}>