<input type=time> does not warn user when submitting with partial value (Chrome does)
Categories
(Core :: DOM: Forms, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox91 | --- | verified |
People
(Reporter: xuerian, Assigned: emilio)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0
Steps to reproduce:
Enter a partial time in a time input (Eg: [01:--:AM], a conceptually valid time)
Submit form
Actual results:
Form is submitted with empty value and no warning
Expected results:
Form should not be submitting and a warning should be shown for the input
Due to #1719010 and #1719007, I can't figure out a work around for this other than onblur="setTimeout(()=>this.value=this.value)"
Chrome correctly warns the user when this happens
Comment 2•3 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Layout: Form Controls' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 3•3 years ago
|
||
Assignee | ||
Comment 4•3 years ago
|
||
So on the above test-case in Chrome input.validity.valid
is false
, and input.validity.badInput
is true
, which I think makes sense.
This piece of code however seems pretty intentional, and is responsible for us not to get the behavior that chrome has.
Assignee | ||
Comment 5•3 years ago
|
||
Assignee | ||
Comment 6•3 years ago
|
||
This matches Chrome.
Updated•3 years ago
|
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/de4c385b1971 Consider incomplete date/time inputs as "bad input". r=smaug
Updated•3 years ago
|
Updated•3 years ago
|
Comment 8•3 years ago
|
||
bugherder |
Updated•3 years ago
|
Comment 9•3 years ago
|
||
Reproduced with Fx 91.0a1 (2021-07-02) on Windows 10.
Verified fixed with Fx 91.0b9 and Fx 92.0a1 (2021-07-29) on Windows 10, macOS 11.0 and Ubuntu 18.04.
Description
•