Skip to content

Commit 985d95f

Browse files
committed
Fix optional widget in Markdown editor component
Fix #472
1 parent a607aaa commit 985d95f

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

src/lib/components/contents/details/widgets/markdown/component.svelte

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,7 @@
7272
});
7373
7474
$effect(() => {
75-
const _inputValues = $state.snapshot(inputValues);
76-
77-
untrack(() => {
78-
if (!equal(values, _inputValues)) {
79-
onChange(new CustomEvent('update', { detail: _inputValues }));
80-
}
81-
});
75+
onChange(new CustomEvent('update', { detail: $state.snapshot(inputValues) }));
8276
});
8377
</script>
8478
@@ -146,6 +140,8 @@
146140
keyPath="{keyPath}:{fieldName}"
147141
fieldId={generateElementId('field')}
148142
{fieldLabel}
143+
required={fieldConfig.required ?? true}
144+
readonly={fieldConfig.readonly ?? false}
149145
{fieldConfig}
150146
context="markdown-editor-component"
151147
bind:currentValue={inputValues[fieldName]}

0 commit comments

Comments
 (0)