diff --git a/.changeset/bright-coins-thank.md b/.changeset/bright-coins-thank.md new file mode 100644 index 000000000..f6b73caf0 --- /dev/null +++ b/.changeset/bright-coins-thank.md @@ -0,0 +1,5 @@ +--- +"@effect-app/vue-components": patch +--- + +fix: watch callback in useOmegaForm diff --git a/packages/vue-components/src/components/OmegaForm/useOmegaForm.ts b/packages/vue-components/src/components/OmegaForm/useOmegaForm.ts index e9ab17165..43bf442cf 100644 --- a/packages/vue-components/src/components/OmegaForm/useOmegaForm.ts +++ b/packages/vue-components/src/components/OmegaForm/useOmegaForm.ts @@ -964,7 +964,7 @@ export const useOmegaForm = < // /** @experimental */ handleSubmitEffect, registerField: (field: ComputedRef<{ name: string; label: string; id: string }>) => { - watch(field, (f) => fieldMap.value.set(f.name, { label: f.label, id: f.id }), { immediate: true }) + watch(field, (f) => { fieldMap.value.set(f.name, { label: f.label, id: f.id }) }, { immediate: true }) onUnmounted(() => { // Only delete if this component instance still owns the registration (id matches) // This prevents the old component from removing the new component's registration