Repository navigation
Document {bind}-object emptyValue store seeding with spec and litmus repro - #1336
Merged
nebojsa-peric merged 1 commit intoOct 7, 2026
Merged
Conversation
Collaborator
Author
|
Tracking the fix in #1337. |
This was referenced Oct 7, 2026
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.
Form fields initialize their store slot differently depending on how the value binding is authored:
value={{ bind: "..." }}, including thevalue-bindshorthand) seeds the path with the field's declaredemptyValue(null) the moment the widget initializes —StructuredSelector.getSelectorConfigcollects the declared prop default intodefaultValuesandinit()writes it to the store.value={model.x}) takes theisAccessorChainbranch, which registers no default, so the slot staysundefineduntil the user interacts.An untouched field therefore leaves
nullorundefinedin the store based solely on binding style. Any code that strict-compares such a slot — e.g.disabled={expr(m.a, m.b, (a, b) => a === b)}with two empty slots — flips its result after a seemingly cosmetic refactor from{bind: ...}to an accessor chain, which is how we ran into this.This PR adds a spec (
Field value binding initialization, 4 cases — including one showing the seeded value follows a customemptyValue, pinning down the mechanism) and a litmus page (bugs/FieldBindingObjectNullSeeding) with a live store dump. No behavior changes — the spec documents the current semantics; whether the asymmetry is intended is up for discussion.