diff --git a/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte b/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte index d11ebcf87a..0792866581 100644 --- a/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte +++ b/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte @@ -4,10 +4,9 @@ readableToRuntimeBinding, runtimeToReadableBinding, } from "dataBinding" - import ClientBindingPanel from "components/common/bindings/ClientBindingPanel.svelte" import { createEventDispatcher, setContext } from "svelte" - import { isJSBinding } from "@budibase/string-templates" + import { isJSBinding, decodeJSBinding } from "@budibase/string-templates" import { builderStore } from "stores/builder" export let panel = ClientBindingPanel @@ -35,7 +34,12 @@ $: isJS = isJSBinding(value) const saveBinding = () => { - onChange(tempValue) + // Don't bother saving empty JS expressions as JS + let val = tempValue + if (decodeJSBinding(tempValue)?.trim() === "") { + val = null + } + onChange(val) onBlur() builderStore.propertyFocus() bindingDrawer.hide()