Repository navigation
Conversation
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.
Summary
Fixes the register form's email warnings (education / typo / disposable) not appearing in the field indicator while typing
test@example.edu(shows the success check instead). Supersedes #8662 (theasyncAlwaysapproach) — same fix, sync validation, plus the two follow-up issues discovered while verifying it.Introducing PR: #7816 (
1cefe7cf4, "refactor: solid settings") rewired the verify-email cross-check from a manualvalidateField("emailVerify")call toonChangeListenTo: ["email"]. form-core then runs the verify field's sync validator inside the email field's sync pass; while typing, the still-empty verify field errors (verify email not matching email), which setshasErroredon the email field — andFieldApi.validateaborts the email's async validation onhasErrored && !asyncAlways.emailIsValidnever runs, so the warning meta is never set.Discovered while fixing: the warning state has no reset, and the indicator can't see resets anyway:
handleResultonly ever sethasWarning/warnings— once shown, a warning stuck on the field permanently after the email stopped matching (latent for a long time: unreachable while the async validation was aborted by refactor: solid settings (@miodec) #7816).hasWarning/warningsare custom meta keys not selected into solid-form's field signal, so a warning-state change alone never re-rendersFieldIndicator. The indicator renders the warning from the previous validation pass — a stale check when a warning first appears, a phantom triangle when it's cleared (verified in the browser).Three-part fix:
// Register.tsx — email field: run the local warning checks in the sync pass, // where they can't be aborted by the linked verify-email mismatch <form.Field name="email" validators={{ - onChange: fromSchema(UserEmailSchema), - onChangeAsyncDebounceMs: 0, - onChangeAsync: async (field) => - handleResult(field.fieldApi, await emailIsValid(field.value)), + onChange: (field) => { + const result = fromSchema(UserEmailSchema)(field); + if (result !== undefined) return result; + return handleResult(field.fieldApi, emailIsValid(field.value)); + }, }}emailIsValidis de-asynced (it contained noawait). TheFieldIndicatorsubscription benefits every form that uses warning meta (register email/username,ThirdPartySignUpModal,SimpleModal,ProfileSearchPage).Evidence
test@example.eduleaves the indicator onfa-check; the field store never showsisValidating: trueorhasWarning(async validator aborted).fa-checkwhen the warning first appears, phantomfa-exclamation-triangleafter it's cleared (browser-verified table below).test@example.educhar by char →fa-exclamation-triangleon the final keystrokex(no warning) →fa-checkx→fa-exclamation-triangleon the same keystrokeplain@example.com→fa-checkFieldIndicatorspecs updated for the store subscription (fake fields gain a minimalstore);utils.spec.tsexpectations unchanged and passing. Full suite: 134 files, 2026 tests, all pass.oxlintcore + type-aware clean.Merge Danger
Door: two-way
Blast Radius: register email field behavior +
FieldIndicatorfor all warning-based forms. Warning meta now updates (and clears) in the same validation pass it changes — the visible change for other forms is that their warnings stop being able to stick, which is the intended behavior.