fix(fill): accept datetime-local values the browser re-serializes
Closed
YU
1mo ago+13+13+01234567890123456789-3-3-0123456789
fill() sets input.value for date and time inputs and throws "Malformed value" unless it reads back as the same string. datetime-local serializes its value in canonical form, omitting zero seconds and using T as the separator, so a valid value like 2020-03-02T06:20:00 was rejected in all browsers.
Browsers sanitize an invalid datetime-local value to an empty string, so for that type any non-empty value the browser kept is now accepted. The other date and time types keep their value as set and still require an exact match.
The existing "should fill datetime-local input" test now also fills a value with zero seconds.