Skip to content

[field] Fix valueMissing revalidation - #4995

Merged
atomiks merged 2 commits into
mui:masterfrom
atomiks:codex/field-value-missing-revalidation
Jun 11, 2026
Merged

atomiks merged 2 commits into
mui:masterfrom
atomiks:codex/field-value-missing-revalidation

Conversation

@atomiks

@atomiks atomiks commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

A required field could keep showing a stale native validation state after a previous native error changed into a required error.

Root cause

isOnlyValueMissing() reset its flag during the valueMissing check, so it never allowed value-missing-only revalidation to continue.

Changes

  • Fixed the helper to only clear the flag for other validity errors.
  • Added coverage for clearing an invalid email field into a required-empty field.

@atomiks atomiks added component: field Changes related to the field component. type: bug It doesn't behave as expected. labels Jun 10, 2026 — with ChatGPT Codex Connector
@pkg-pr-new

pkg-pr-new Bot commented Jun 10, 2026 •

Copy link
Copy Markdown
  • base-ui-tanstack-start

  • vite-css-base-ui-example

    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui/react@4995
    
    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui/utils@4995
    

commit: 350f256

@code-infra-dashboard

code-infra-dashboard Bot commented Jun 10, 2026 •

Copy link
Copy Markdown

Bundle size

Bundle Parsed size Gzip size
@base-ui/react ▼-3B(0.00%) 🔺+1B(0.00%)

Details of bundle changes

Performance

Total duration: 1,286.27 ms +64.18 ms(+5.3%) | Renders: 50 (+0) | Paint: 1,929.11 ms +81.45 ms(+4.4%)

Test Duration Renders
Mixed surface mount (app-like density) 84.26 ms 🔺+19.95 ms(+31.0%) 5 (+0)

11 tests within noise — details


Check out the code infra dashboard for more information about this PR.

@netlify

netlify Bot commented Jun 10, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 350f256
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6a2a0cee6c62130008cabef8
😎 Deploy Preview https://deploy-preview-4995--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@atomiks
atomiks marked this pull request as ready for review June 10, 2026 07:42

atomiks commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

Code Review (GPT-5.5)

Approve ✅ The valueMissing revalidation fix targets the stale native validity transition directly and adds focused regression coverage for the required-empty handoff.

1. Bugs / Issues (None)

I didn’t find any blocking or non-blocking issues in the branch diff.

2. Root Cause & Patch Assessment

The helper previously let the valueMissing branch immediately fall through to the generic state[key] branch, clearing onlyValueMissing for exactly the case it was supposed to preserve. Changing that second check to else if keeps value-missing-only revalidation enabled while still rejecting any other native validity errors.

3. Test Coverage Assessment

The new Field.Root regression covers the important sequence: an invalid email is blurred into a typeMismatch error, then clearing the input immediately switches to the required valueMissing error instead of leaving stale type-mismatch state.

@atomiks
atomiks merged commit 34f5423 into mui:master Jun 11, 2026
6 checks passed
@atomiks
atomiks deleted the codex/field-value-missing-revalidation branch June 11, 2026 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: field Changes related to the field component. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant