Closed Bug 1918521 Opened 1 year ago Closed 1 year ago

Can't type leap year in date input (because we think it's a wrong date when typing the year?)

Categories

(Core :: Layout: Form Controls, defect, P3)

Firefox 130
defect

Tracking

()

VERIFIED FIXED
133 Branch
Tracking Status
firefox133 --- verified
firefox134 --- verified

People

(Reporter: vivian.li.uibe, Assigned: tannal2409, Mentored)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36

Steps to reproduce:

I created a playcode to create this.
02/29/2024, or any leap year can't be inserted to date input.
This happens only when firefox browser is used.

https://playcode.io/2005664

Actual results:

After keyboard input 02292024, the input display is mm/dd/0004.

Expected results:

After keyboard input 02292024, the input display is 02/29/2024

The Bugbug bot thinks this bug should belong to the 'Core::Layout: Form Controls' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Layout: Form Controls
Product: Firefox → Core

If you insert the year first then it works... But yeah this looks wrong.

Relevant code is here, I suspect something in setinputvaluefromfields or so ends up clearing the input.

I'd be happy to mentor someone to fix this...

Mentor: emilio
Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P3
Summary: leap year date input issue → Can't type leap year in date input (because we think it's a wrong date when typing the year?)

A simple fix might be deleting this line https://searchfox.org/mozilla-central/rev/181e5bb2645236a617d42e3740420098097f7a0f/toolkit/content/widgets/datetimebox.js#1175.
Can I debug toolkit/content/widgets/datetimebox.js in firefox devtools just like regular js files?
I didn't find it in the debugger panel (using ctrl + p).

Flags: needinfo?(emilio)

You can do it with the browser toolbox.

Flags: needinfo?(emilio)

User might still typing even if all three fields are not empty.

Assignee: nobody → tannal2409
Status: NEW → ASSIGNED
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/66f309dfb9c2 Remove SetInputValueFromFields when handlekeydown in datetimebox. r=emilio
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 133 Branch

Reproducible on a 2024-09-12 Nightly build on Windows 10.
Verified as fixed on Firefox 133.0b1 and Firefox Nightly 134.0a1 on Windows 10, macOS 14, Ubuntu 22.

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

Attachment

General

Creator:
Created:
Updated:
Size: