From 667bcac680204093bfc64acaec829eda55e12ae3 Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Sun, 29 Jan 2023 20:05:11 +0200 Subject: [PATCH] updated initial json field reactivity --- ui/src/components/records/fields/JsonField.svelte | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/src/components/records/fields/JsonField.svelte b/ui/src/components/records/fields/JsonField.svelte index af7df06c..7e9a3043 100644 --- a/ui/src/components/records/fields/JsonField.svelte +++ b/ui/src/components/records/fields/JsonField.svelte @@ -6,10 +6,11 @@ export let field = new SchemaField(); export let value = undefined; - let serialized = undefined; + let serialized = JSON.stringify(typeof value === "undefined" ? null : value, null, 2); $: if (value !== serialized?.trim()) { - serialized = JSON.stringify(value, null, 2); + serialized = JSON.stringify(typeof value === "undefined" ? null : value, null, 2); + value = serialized; }