Closed
Bug 1460078
Opened 8 years ago
Closed 6 years ago
Date picker year selection list doesn't default to current year for empty <input>
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(firefox60 unaffected, firefox61 unaffected, firefox62 affected)
RESOLVED
WONTFIX
| Tracking | Status | |
|---|---|---|
| firefox60 | --- | unaffected |
| firefox61 | --- | unaffected |
| firefox62 | --- | affected |
People
(Reporter: JanH, Assigned: JanH)
References
()
Details
(Whiteboard: [priority:medium])
Attachments
(1 file)
|
2.89 MB,
video/mp4
|
Details |
If you click into an empty "date" <input> field, the calendar view shows today's date as selected, however if you then directly switch into the year view, the list is scrolled to start at 1900.
If however you first click into the calendar view to select a date - even the same date that is already appears selected - then the year view will be correctly scrolled to show year corresponding to the selected date. Likewise, if you open the date picker for an <input> that already has a date set, then the year view will display the correct year after opening.
Flags: needinfo?(petru.lingurar)
Comment 1•8 years ago
|
||
Thanks Jan for the recent reports!
As you may know in the current implementation for "date" and "time" we are using the platform's DatePicker and TimePicker, didn't think they were this buggy.
I now saw that Chrome also has problems with this kind of inputs while in landscape.
Regarding the reported issue, I was not able to reproduce it on Samsung J3 - Android 5.1.1 or Samsung S7 - Android 7.0.
Updated•8 years ago
|
Flags: needinfo?(jh+bugzilla)
| Assignee | ||
Comment 2•8 years ago
|
||
(In reply to Petru-Mugurel Lingurar[:petru] from comment #1)
> I now saw that Chrome also has problems with this kind of inputs while in
> landscape.
Yes, the "rotate device while picker is open" doesn't really work for them either, and their time picker is completely unuseable if initially opened in landscape mode. Their date picker however works better when initially opened in landscape mode compared to ours, because they use a greater proportion of the available screen width.
| Assignee | ||
Comment 3•8 years ago
|
||
My phone: Moto G4 Play, Android 6.0.1.
I think your video matches my STR, so this might be a device and/or OS version-specific issue. If you cannot reproduce this at all, I might be able to try finding a workaround myself.
Flags: needinfo?(petru.lingurar)
Flags: needinfo?(jh+bugzilla)
| Assignee | ||
Comment 4•8 years ago
|
||
... I haven't looked at the code yet, but given that this seems to work if the <input> element already has a date set with which we initialise the date picker, this might be as simple as simply always explicitly initialising the date picker control an appropriate date - either the value set in the <input> element, or else explicitly set today's date (subject to any min/max restrictions on the <input> element).
Comment 5•8 years ago
|
||
(In reply to Jan Henning [:JanH] from comment #4)
> ... I haven't looked at the code yet, but given that this seems to work if
> the <input> element already has a date set with which we initialise the date
> picker, this might be as simple as simply always explicitly initialising the
> date picker control an appropriate date - either the value set in the
> <input> element, or else explicitly set today's date (subject to any min/max
> restrictions on the <input> element).
We should already do this [1] unless the value is already set or somehow while trying to set the current date an error occurred.
[1] https://dxr.mozilla.org/mozilla-central/source/mobile/android/base/java/org/mozilla/gecko/prompts/PromptInput.java#185
| Assignee | ||
Comment 6•8 years ago
|
||
Yes, but only if "!TextUtils.isEmpty(mValue)". So if the value *is* empty, we leave the date selection to whatever default logic applies, which apparently is slightly buggy in my case.
Comment 7•8 years ago
|
||
Tested with Nokia 6(Android 7.1.1), Prestigio Grace X5 (Android 4.4.2), Oneplus Two (Android 6.0.1) and Google Pixel (Android 8.1.0) and the issue is not reproducible on latest Nightly build. The results are the same as in comment 1.
Updated•8 years ago
|
Whiteboard: [priority:medium]
Updated•7 years ago
|
Assignee: nobody → petru.lingurar
Status: NEW → ASSIGNED
Comment 8•7 years ago
|
||
Tested this again on latest Nightly and didn't saw the issue.
In the case that this might be device dependent can you try and test for it again Jan?
Flags: needinfo?(jh+bugzilla)
| Assignee | ||
Comment 9•7 years ago
|
||
Still happening on my phone - as I said above, this might be a device-specific issue. So if the <input> doesn't specify any default value, i.e. mValue is empty, we should just explicitly set today's date, clamped by any min/max restrictions on the <input> element of course.
Flags: needinfo?(jh+bugzilla)
| Assignee | ||
Comment 10•7 years ago
|
||
Also I guess it's best if I take this for easier debugging/testing, then.
Assignee: petru.lingurar → jh+bugzilla
| Assignee | ||
Comment 11•7 years ago
|
||
> clamped by any min/max restrictions on the <input> element of course
Hmm, I see that the patches for switching to the system date picker have regressed on min/max value support...
| Assignee | ||
Updated•7 years ago
|
Status: ASSIGNED → NEW
| Assignee | ||
Updated•6 years ago
|
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
Updated•5 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•