Bug 248401 - ValidityState reports "valid" for partially completed dates
Summary: ValidityState reports "valid" for partially completed dates
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: WebKit Nightly Build
Hardware: Mac (Intel) macOS 11
: P2 Normal
Assignee: Tim Nguyen (:ntim)
URL:
Keywords: BrowserCompat, InRadar
Depends on:
Blocks:
 
Reported: 2022-11-28 09:13 PST by Jeremy Frey
Modified: 2023-05-05 22:27 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremy Frey 2022-11-28 09:13:36 PST
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
Comment 2 Radar WebKit Bug Importer 2022-12-05 09:14:17 PST
<rdar://problem/102984901>
Comment 3 Tim Nguyen (:ntim) 2023-05-05 14:58:26 PDT
Pull request: https://github.com/WebKit/WebKit/pull/13523
Comment 4 EWS 2023-05-05 22:27:05 PDT
Committed 263748@main (ec9036933491): <https://commits.webkit.org/263748@main>

Reviewed commits have been landed. Closing PR #13523 and removing active labels.