| Summary: | ValidityState reports "valid" for partially completed dates | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Jeremy Frey <jeremy.m.frey> |
| Component: | Forms | Assignee: | Tim Nguyen (:ntim) <ntim> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | akeerthi, cdumez, karlcow, webkit-bug-importer, wenson_hsieh |
| Priority: | P2 | Keywords: | BrowserCompat, InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Mac (Intel) | ||
| OS: | macOS 11 | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=148873 | ||
Probably related to http://wpt.live/html/semantics/forms/constraints/form-validation-checkValidity.html https://wpt.fyi/results/html/semantics/forms/constraints/form-validation-checkValidity.html?label=experimental&label=master&aligned Pull request: https://github.com/WebKit/WebKit/pull/13523 Committed 263748@main (ec9036933491): <https://commits.webkit.org/263748@main> Reviewed commits have been landed. Closing PR #13523 and removing active labels. |
Repro steps: 1. In an `<input type="date" />` element, use the keyboard to enter the month, day, or year portion of the date. 2. Leave the other date parts blank. 3. Inspect the element's ValidityState. Expected: `{ badInput: true, valid: false }` Actual: `{ badInput: false, valid: true }` AFAIK, Blink and Gecko report badInput: true in this scenario. A closely-related question was asked on SO which doesn't have any answers due to the current behavior: https://stackoverflow.com/questions/72915862/javascript-date-input-in-safari-validation-31-of-february-year