Small tweak to JS bindings

This commit is contained in:
Andrew Kingston 2024-05-22 10:45:03 +01:00
parent 41ab3685be
commit 3cf3dd3afa
1 changed files with 3 additions and 2 deletions

View File

@ -236,11 +236,12 @@
}
const onChangeJSValue = e => {
jsValue = encodeJSBinding(e.detail)
if (!e.detail?.trim()) {
// Don't bother saving empty values as JS
updateValue("")
updateValue(null)
} else {
updateValue(encodeJSBinding(e.detail))
updateValue(jsValue)
}
}