Closed Bug 1719011 Opened 3 years ago Closed 3 years ago

<input type=time> does not warn user when submitting with partial value (Chrome does)

Categories

(Core :: DOM: Forms, defect)

Firefox 90
defect

Tracking

()

VERIFIED FIXED
91 Branch
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

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.

Component: Untriaged → Layout: Form Controls
Product: Firefox → Core
Attached file test-case

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.

Status: UNCONFIRMED → NEW
Ever confirmed: true
See Also: → 1372369
Assignee: nobody → emilio
Status: NEW → ASSIGNED
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/de4c385b1971
Consider incomplete date/time inputs as "bad input". r=smaug
Severity: -- → S3
Component: Layout: Form Controls → DOM: Forms
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 91 Branch
Flags: qe-verify+

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.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: