fix(form): thread live dependentValues to cascading option fields (#2284)#2620
Merged
Conversation
) Registered option widgets (field:select / field:radio / field:multiselect) that carry per-option `visibleWhen` + `dependsOn` cascading were excluded from the form renderer's `dependentValues` injection — only DATA_SOURCE_FIELD_TYPES (lookup/master_detail/…) received it. `stripRegisteredFieldProps` therefore dropped `dependentValues` before it reached SelectField, and with no `formValues` context fallback the widget's `dependsOn` gate never saw the controlling field: a cascading select stayed permanently gated on the "Select the parent first" hint even after the parent was chosen (reproduced on the showcase `showcase_cascade` B3 fixture — country → province never unlocked). Option field types now receive `dependentValues` too, mirroring the lookup fix (#2215/#2216). Verified end-to-end in the browser against the showcase B3 fixture: province gates until country is set, offers CN provinces for China, and re-filters to US states when country flips. Regression guard added in form-dependent-values.test.tsx driving the registered field:select path (the prior cascading-select test only covered the builtin `case 'select'` fallback, which reads options from the renderer's own ruleRecord and so never exercised the widget-injection gap). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
68 tasks
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
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
The B3 cascading-select feature (#2284 / framework #1583) is broken in the real create/edit form. On the showcase
showcase_cascadefixture, picking a Country never unlocks the dependent Province — it stays gated on the "Select country first" hint forever.Root cause
The form renderer injects the live form record (
dependentValues) only intoDATA_SOURCE_FIELD_TYPES(lookup/master_detail/object-ref/…). Registered option widgets —field:select/field:radio/field:multiselect— were excluded, sostripRegisteredFieldPropsdroppeddependentValuesbefore it reachedSelectField.With no live record and no
formValuescontext fallback (that member never existed onSchemaRendererContext— same gap the lookup fix #2215/#2216 called out),SelectField'sdependsOngate never saw the controlling field. The builtincase 'select'fallback works (it readseffectiveOptionsfrom the renderer's ownruleRecord), but the registeredfield:selectpath thatObjectFormactually uses did not.Fix
Thread
dependentValuesto option field types too (one addedSet+ one spread), mirroring the lookup fix.Verification
form-dependent-values.test.tsxdrives the registeredfield:selectpath (not the builtin fallback the prior cascading-select test covered). Fails without the fix (dependentValuesarrivesnull), passes with it.Surfaced during framework 15.1 release QA (the B3 cascade is a touted 15.1 line item). The opt-in live e2e
e2e/live/cascading-options.spec.tsis not in default CI, which is why this shipped unnoticed.🤖 Generated with Claude Code