Skip to content

[field] Publish neutral validity while async validation is in flight - #5600

Open
atomiks wants to merge 5 commits into
mui:masterfrom
atomiks:claude/dazzling-snyder-d8c679
Open

[field] Publish neutral validity while async validation is in flight#5600
atomiks wants to merge 5 commits into
mui:masterfrom
atomiks:claude/dazzling-snyder-d8c679

Conversation

@atomiks

@atomiks atomiks commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

While an async validate function is in flight, the field published data-valid (a fresh all-clear from native constraints) even though the result is unknown, and only validationMode="onSubmit" retired the previous result. It also dropped known native failures in that window, so a required or type="email" field could submit past its native constraint when paired with an async validator.

The pending window now maps to the existing neutral state (valid: null, no data-valid/data-invalid/aria-invalid), consistently across modes. The only results kept mid-flight are the ones the form must read synchronously to block submission:

  • native constraint failures, published in every mode
  • a previously resolved async error in onChange/onBlur (async results can't block in onSubmit mode, per the validate docs)

A previously valid result retires in every mode, so no stale success shows for a value that was never validated.

publish/makeValidityData accept valid: null internally; public types already allowed it.

@atomiks atomiks added type: regression A bug, but worse, it used to behave as expected. component: field Changes related to the field component. labels Aug 31, 2026
@pkg-pr-new

pkg-pr-new Bot commented Aug 31, 2026

Copy link
Copy Markdown

commit: ef9fe18

@code-infra-dashboard

code-infra-dashboard Bot commented Aug 31, 2026

Copy link
Copy Markdown

Bundle size

Bundle Parsed size Gzip size
@base-ui/react 🔺+60B(+0.01%) 🔺+29B(+0.02%)

Details of bundle changes

Performance

Total duration: 1,224.35 ms 🔺+258.15 ms(+26.7%) | Renders: 76 (+0) | Paint: 1,960.74 ms 🔺+403.68 ms(+25.9%)

Test Duration Renders
Tabs mount (200 instances) 277.25 ms 🔺+84.38 ms(+43.7%) 3 (+0)
Select mount (200 instances) 137.87 ms 🔺+25.40 ms(+22.6%) 3 (+0)
Slider mount (300 instances) 130.37 ms 🔺+22.91 ms(+21.3%) 2 (+0)
Menu open (500 items) 80.36 ms 🔺+18.86 ms(+30.7%) 11 (+0)
Menu mount (300 instances) 95.40 ms 🔺+16.58 ms(+21.0%) 1 (+0)

…and 5 more (+5 within noise) — details

Metric alarms

Test Metric Change
Tabs mount (200 instances) bench:paint 🔺 +107.95 ms
Select mount (200 instances) bench:paint 🔺 +37.77 ms
Slider mount (300 instances) bench:paint 🔺 +47.74 ms
Menu open (500 items) bench:paint 🔺 +23.95 ms
Menu open (500 items) bench:paint#menu-open 🔺 +23.95 ms

…and 10 more metric alarms — details


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

@netlify

netlify Bot commented Aug 31, 2026

Copy link
Copy Markdown

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit ef9fe18
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6a952867c39a8900085dc5c8
😎 Deploy Preview https://deploy-preview-5600--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 August 31, 2026 07:26
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: regression A bug, but worse, it used to behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant