aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordan <[email protected]>2023-08-31 11:58:20 -0400
committerdan <[email protected]>2023-08-31 11:58:20 -0400
commit3baf3c177f86dcc01ce49e14daec7c5c895eefe6 (patch)
tree0ffca65b05046ee5d6ef9442671295925d64d501
parent016726b12fe4deb3b0beef24d5aefa29e35dfb1e (diff)
downloaddraggable-form-demo-3baf3c177f86dcc01ce49e14daec7c5c895eefe6.tar.gz
draggable-form-demo-3baf3c177f86dcc01ce49e14daec7c5c895eefe6.tar.bz2
draggable-form-demo-3baf3c177f86dcc01ce49e14daec7c5c895eefe6.zip
refactor: remove log statements
-rw-r--r--src/components/FormBuilder/index.js6
1 files changed, 0 insertions, 6 deletions
diff --git a/src/components/FormBuilder/index.js b/src/components/FormBuilder/index.js
index 8a13bf0..5636b32 100644
--- a/src/components/FormBuilder/index.js
+++ b/src/components/FormBuilder/index.js
@@ -97,7 +97,6 @@ function WidgetCard({ name, element, type, finalElement }) {
function onDragStart(e) {
e.dataTransfer.setData("application/formwidgettype", type);
e.dataTransfer.effectAllowed = "copy";
- console.log(e);
}
const disabledFieldOverlay = {
@@ -201,7 +200,6 @@ function DropZone({ insertField, index, moveField }) {
e.stopPropagation();
e.preventDefault();
setDragOver(false);
- console.log(e);
if ([...e.dataTransfer.types].includes("application/formwidgettype")) {
const type = e.dataTransfer.getData("application/formwidgettype");
insertField({ index, type });
@@ -233,10 +231,8 @@ function Form({ initialForm, editable }) {
...form,
fields: form.fields.filter((field) => id !== field?.id),
};
- console.log("deleteFormField", { id, form, newForm });
setForm({ ...newForm });
}
- console.log("render", form.fields);
function insertField({ index, type }) {
const id = crypto.randomUUID();
@@ -249,14 +245,12 @@ function Form({ initialForm, editable }) {
}
function moveField(oldId, newIndex) {
- console.log({ oldId, newIndex });
const oldIndex = form.fields.findIndex(({ id }) => id === oldId);
const [oldFormField] = form.fields.splice(oldIndex, 1);
if (oldIndex > newIndex) {
newIndex++;
}
form.fields.splice(newIndex, 0, oldFormField);
- console.log("newform", form);
setForm({ ...form });
}