From 852fd0e2957804f3cc57d37a6a50c347beec5909 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Wed, 4 Sep 2024 06:01:01 +0000 Subject: [PATCH] fix: if json string is invalid avoid trying to save on enter key press --- packages/nc-gui/components/cell/Json.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/nc-gui/components/cell/Json.vue b/packages/nc-gui/components/cell/Json.vue index 8bea88c6df..b828243543 100644 --- a/packages/nc-gui/components/cell/Json.vue +++ b/packages/nc-gui/components/cell/Json.vue @@ -86,6 +86,9 @@ const onSave = () => { editEnabled.value = false + // avoid saving if error exists or value is same as previous + if (error.value || localValue.value === vModel.value) return false + vModel.value = formatValue(localValue.value) === null ? null : formatJson(localValue.value as string) }