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) => {
|
||||
setSelectedFieldType(e);
|
||||
}}
|
||||
onMouseDown={(e: any) => {
|
||||
if (e.button === 0) props.setAdding(true);
|
||||
}}
|
||||
>
|
||||
<div className="space-y-4">
|
||||
{fieldTypes.map((fieldType) => (
|
||||
|
||||
@ -20,7 +20,6 @@ export default function PDFEditor(props: any) {
|
||||
const noRecipients =
|
||||
props?.document.Recipient.length === 0 ||
|
||||
props?.document.Recipient.every((e: any) => !e.email);
|
||||
const [adding, setAdding] = useState(false);
|
||||
|
||||
function onPositionChangedHandler(position: any, id: any) {
|
||||
if (!position) return;
|
||||
@ -62,11 +61,6 @@ export default function PDFEditor(props: any) {
|
||||
onMouseUp={(e: any, page: number) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
console.log(adding);
|
||||
if (adding) {
|
||||
addField(e, page);
|
||||
setAdding(false);
|
||||
}
|
||||
}}
|
||||
onMouseDown={(e: any, page: number) => {
|
||||
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>
|
||||
<FieldTypeSelector
|
||||
setAdding={setAdding}
|
||||
selectedRecipient={selectedRecipient}
|
||||
onChange={setSelectedFieldType}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user