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)
Tracking
()
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.
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
| Comment 1•1 year 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 correct in case you think the bot is wrong.
| Comment 2•1 year ago
           | ||
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...
| Assignee | ||
| Comment 3•1 year ago
           | ||
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).
| Assignee | ||
| Comment 5•1 year ago
           | ||
User might still typing even if all three fields are not empty.
| Updated•1 year ago
           | 
| Comment 7•1 year ago
           | ||
| bugherder | ||
| Updated•1 year ago
           | 
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.
 
Description
•