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)

Firefox 62
All
Android
defect
Not set
normal

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)

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)
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.
Flags: needinfo?(jh+bugzilla)
(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.
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)
... 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).
(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
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.
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.
Whiteboard: [priority:medium]
Assignee: nobody → petru.lingurar
Status: NEW → ASSIGNED
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)
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)
Also I guess it's best if I take this for easier debugging/testing, then.
Assignee: petru.lingurar → jh+bugzilla
> 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...
Status: ASSIGNED → NEW
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: