From 77d0a556bd316a88a277227e93b2e1596c00cf4c Mon Sep 17 00:00:00 2001 From: Maurits Lourens Date: Tue, 18 Jan 2022 10:45:37 +0100 Subject: [PATCH] reset field.name to originalName after cancel --- .../backend/DataTable/modals/CreateEditColumn.svelte | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte index 752f291019..f84f9edde8 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte @@ -126,6 +126,10 @@ } } + function cancelEdit() { + field.name = originalName + } + function deleteColumn() { if (field.name === $tables.selected.primaryDisplay) { notifications.error("You cannot delete the display column") @@ -307,6 +311,7 @@ title={originalName ? "Edit Column" : "Create Column"} confirmText="Save Column" onConfirm={saveColumn} + onCancel={cancelEdit} disabled={invalid} >