fix: restore OmegaForm input reactivity with @tanstack/vue-form 1.32#757
Merged
Conversation
@tanstack/vue-form inverted its Field slot reactivity between 1.23.5 and 1.32.0. The slot's `state` prop is now a one-time snapshot taken when the field mounts, while `field.state` is a reactive getter backed by the field store. OmegaForm bound inputs to the slot `state` prop, so the store updated but the view never did. Switch the Field slot consumers (OmegaInput, OmegaArray) to read from the reactive `field.state` instead, and correct the now-inverted doc comment in InputProps.ts.
@effect-app/cli
effect-app
@effect-app/eslint-codegen-model
@effect-app/eslint-shared-config
@effect-app/infra
@effect-app/vue
@effect-app/vue-components
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
After bumping
@tanstack/vue-formfrom1.23.5to1.32.0(#755), typing in OmegaForm inputs no longer updates the view — the form store value changes, but the rendered input is frozen.Repro:
components-omegaform--simple-formstory.Root cause
@tanstack/vue-forminverted itsFieldslot reactivity between the two versions.useFieldreturnedstateas a ref, andFieldunwrapped it inside its render function. The slotstateprop was reactive;field.statewas not.useFieldreturnsstate: fieldState.value, unwrapped once. TheFieldcomponent passes that frozen snapshot as the slotstateprop. Reactivity moved ontofield.state, now a reactive getter.OmegaForm bound inputs to the slot
stateprop (OmegaInput → OmegaInternalInput → OmegaInputVuetify,:model-value="state.value"). After the bump that prop is a static snapshot, so the view never re-renders.The same #755 commit's
OmegaTaggedUnionrefactor (offinputProps.state.valueontocurrentTagfrom the form store) was half-addressing this — the input path was missed.Fix
Switch the
form.Fieldslot consumers from the deadstateprop to the reactivefield.state:OmegaInput.vue—:state="field.state"(drives all input types)OmegaArray.vue—pre-array/post-array/ item slots forwardfield.state/subField.stateInputProps.ts— correct the now-inverted doc commentVerification
InputReactivity.test.ts— fails before the fix (expected '' to be 'hello'), passes after.components-omegaform--simple-form: typing updates the view live.🤖 Generated with Claude Code