mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 00:03:33 +10:00
bugfix multiple fields added after field type change: removed "drag drop" feeling handlers
This commit is contained in:
@ -25,9 +25,6 @@ export default function FieldTypeSelector(props: any) {
|
|||||||
onChange={(e: any) => {
|
onChange={(e: any) => {
|
||||||
setSelectedFieldType(e);
|
setSelectedFieldType(e);
|
||||||
}}
|
}}
|
||||||
onMouseDown={(e: any) => {
|
|
||||||
if (e.button === 0) props.setAdding(true);
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
{fieldTypes.map((fieldType) => (
|
{fieldTypes.map((fieldType) => (
|
||||||
|
|||||||
@ -20,7 +20,6 @@ export default function PDFEditor(props: any) {
|
|||||||
const noRecipients =
|
const noRecipients =
|
||||||
props?.document.Recipient.length === 0 ||
|
props?.document.Recipient.length === 0 ||
|
||||||
props?.document.Recipient.every((e: any) => !e.email);
|
props?.document.Recipient.every((e: any) => !e.email);
|
||||||
const [adding, setAdding] = useState(false);
|
|
||||||
|
|
||||||
function onPositionChangedHandler(position: any, id: any) {
|
function onPositionChangedHandler(position: any, id: any) {
|
||||||
if (!position) return;
|
if (!position) return;
|
||||||
@ -62,11 +61,6 @@ export default function PDFEditor(props: any) {
|
|||||||
onMouseUp={(e: any, page: number) => {
|
onMouseUp={(e: any, page: number) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
console.log(adding);
|
|
||||||
if (adding) {
|
|
||||||
addField(e, page);
|
|
||||||
setAdding(false);
|
|
||||||
}
|
|
||||||
}}
|
}}
|
||||||
onMouseDown={(e: any, page: number) => {
|
onMouseDown={(e: any, page: number) => {
|
||||||
if (e.button === 0) addField(e, page);
|
if (e.button === 0) addField(e, page);
|
||||||
@ -82,7 +76,6 @@ export default function PDFEditor(props: any) {
|
|||||||
/>
|
/>
|
||||||
<hr className="m-3 border-slate-300"></hr>
|
<hr className="m-3 border-slate-300"></hr>
|
||||||
<FieldTypeSelector
|
<FieldTypeSelector
|
||||||
setAdding={setAdding}
|
|
||||||
selectedRecipient={selectedRecipient}
|
selectedRecipient={selectedRecipient}
|
||||||
onChange={setSelectedFieldType}
|
onChange={setSelectedFieldType}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user