Closed Bug 1318046 Opened 8 years ago Closed 7 years ago

Input type="date" doesn't allow switching between years

Categories

(Firefox for Android Graveyard :: General, defect, P1)

defect

Tracking

(firefox50 wontfix, firefox51 wontfix, firefox52 wontfix, firefox62 fixed)

RESOLVED FIXED
Firefox 62
Tracking Status
firefox50 --- wontfix
firefox51 --- wontfix
firefox52 --- wontfix
firefox62 --- fixed

People

(Reporter: miroslav, Assigned: petru)

References

()

Details

(Keywords: DevAdvocacy, Whiteboard: [Leanplum] [61])

Attachments

(5 files)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36 Steps to reproduce: Tap on any input type="date" form field. Actual results: Firefox will show date input popup where I can swipe between months, but I can't easily switch to a different year. This is extremely inconvenient if the date is considerably different from the provided default value. Date of birth is a good example - if the default is today, then 30 years old person will have to swipe 360 times to get to his birth date. Typing it in isn't an option as the date picker will override keyboard input. Expected results: Chrome allows taping the year in the dialog to select year directly.
Thanks for report! Tested with Nexus 9 (Android 7.0) and LG G4 (Android 5.1) on all branches, and I was able to reproduce this. On Firefox I can't switch to another year, but on Chrome this is possible. I will mark this as NEW and set the flags accordingly.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Version: 50 Branch → Trunk
I'm not a great fan of "bump" or "+1", but this bug is really disappointing. Worst thing is that some times ago (sorry, can't remember when nor which version was) it was working perfectly. Please fix it ASAP! Thanks
Mass wontfix for bugs affecting firefox 52.
The issue is also reproducible on www.voot.com, when creating a new account. The Date of Birth field is affected. The issue is not reproducible on Chrome (Mobile) 59.0.3071.125.
Sorry for chiming in but I'm also affected by this bug. I just wanted to register myself for the next election in Germany but using the QR code the website is pretty much unusable in Firefox Android because I need to enter my birth date which takes a few hundred swipes. The LineageOS Browser Jelly by the way eliminates this problem by displaying the year as the first item before the day & month in the date picker. You can then click the year and easily change it.
This seems to be an important bug that has been around for about "a year ago" according to the first posting. I'm testing to see if I should make the switch with all this Firefox Quantum hype, but if this is how Mozilla handles their bugs I might need to try a different browser that will sync between my phones and PC's.
I just ran into this. I had to spend several minutes scrolling through 80-some years * 12 months to get to my birthday. *Twice*. To say that it was infuriating is a bit of an understatement. https://irccloud.mozilla.com/file/bh8LhKMC Can we get this prioritized a bit higher? Not sure who to nag these days. Kevin, Nick, can you please redirect to someone appropriate?
Flags: needinfo?(nalexander)
Flags: needinfo?(kbrosnan)
Redirecting to the project leads.
Flags: needinfo?(snorp)
Flags: needinfo?(nalexander)
Flags: needinfo?(kbrosnan)
Flags: needinfo?(jcheng)
Flags: needinfo?(abovens)
The current date picker is implemented in Fennec, and not Gecko or GV. Wesly, can you help triage this?
Flags: needinfo?(snorp) → needinfo?(wehuang)
Indeed inconvenient, something we may consider to do recently and I'll bring it to Sprint 69.5 planning discussion. (keep my ni)
Priority: -- → P2
Hi Sebastian Do you know why we use custom view for DateTimePicker instead of using Android's system DatePicker/TimePicker? Thanks!
Flags: needinfo?(s.kaspari)
I also think it makes sense to use the system DatePicker/TimePicker rather than our own solution. Better OS integration, easier learning curve.
Flags: needinfo?(abovens)
We already use the default TimePicker for time input: https://dxr.mozilla.org/mozilla-central/source/mobile/android/base/java/org/mozilla/gecko/prompts/PromptInput.java#208 We could presumably likewise also use the system DatePicker for date input fields, and interestingly enough we already do so when according to the source code the SDK is too *old* for our custom date picker [1]. Without some research into the history of this feature I've got no idea though why we decided to use our custom date picker instead of the OS-provided one and what we might need to watch out for when switching back to the system DatePicker. We will still need our custom DateTimePicker for things like week and month input, though and possibly also for datetime input fields, although the latter part is affected by this bug as well and needs fixing, too. In the worst case we could try simply switching off the calendar view for datetime fields and just showing spinners for the date as well to make changing years easier, which is also what Chrome does (although a solution that would keep the calendar view available would of course be nicer). [1] https://dxr.mozilla.org/mozilla-central/rev/21ddfb9e6cc008e47da89db50e22697dc7b38635/mobile/android/base/java/org/mozilla/gecko/prompts/PromptInput.java#187-188, although looking at https://dxr.mozilla.org/mozilla-central/rev/21ddfb9e6cc008e47da89db50e22697dc7b38635/mobile/android/base/java/org/mozilla/gecko/prompts/PromptInput.java#239 I'm not sure if in practice that code path would actually still work
keep it P2 for now as we see other bugs to tackle in Nightly 60 first.
Flags: needinfo?(wehuang)
[triage] This sucks - let's add it as a P1 and consult higher-level triage if we can get cycles to work on it.
Flags: needinfo?(jcheng)
Priority: P2 → P1
Susheel, how important do you think this is? I think it could be a P1 because inputting dates is a simple use case that we're failing at.
Flags: needinfo?(sdaswani)
Yes, I agree - this should be fixed ASAP. Let me figure out who should fix it.
Flags: needinfo?(s.kaspari)
Whiteboard: [Leanplum] [61]
Assignee: nobody → petru.lingurar
Status: NEW → ASSIGNED
Thanks for posting your findings Jan! I started also investigating this and found the original implementation to be from 6 years ago [1] Found some reasoning for our custom DateTimePicker - [2] Basically at that time, our implementation ported the newly introduced picker widgets to lower api's. Because nothing changed in the meantime code-wise I guess this problem is 6 years old. Tested various possible input times with a simple jsfiddle - https://jsfiddle.net/x61pj77L/ and found that indeed there are differences versus Chrome, and we should do better. I'll post my findings below. - In regards to a picker for "date" please refer to attachment 8972922 [details] Here you can see how Firefox currently displays a date picker. Indeed the user cannot directly select a year, he can just scroll upwards until he get to the needed date. On Chrome if the user taps on the year he can select any year. What's more, if the initial try to use a DateTimePicker fails the app resorts to use the platform's DatePicker [3] and then will crash because of a cast exception [4] Also I think widget's header's colours scheme (2nd screenshot in the image) could be better. - In regards to a picker for "time" please refer to attachment 8972924 [details] It is already using platform's picker, all good, but again, I think the color scheme could be improved. - In regards to a picker for "datetime / datetime-locale" please refer to attachment 8972925 [details] As Jan said this part is also affecting by the bug and the user cannot select the year here also. He can just scroll until he gets to the desired date. AFAIK Android does not allow a built-in widget for allowing users to select date and time at the same time. This is why I think we should port the DatePicker widget in our code for DateTimePicker to allow selecting the year also and basically get the UX that Chrome offers. And also maybe change the color scheme.. [1]https://bugzilla.mozilla.org/show_bug.cgi?id=730330 [2]https://bugzilla.mozilla.org/show_bug.cgi?id=730330#c19 [3]https://dxr.mozilla.org/mozilla-central/source/mobile/android/base/java/org/mozilla/gecko/prompts/PromptInput.java#186 [4]https://dxr.mozilla.org/mozilla-central/source/mobile/android/base/java/org/mozilla/gecko/prompts/PromptInput.java#246
(In reply to Petru-Mugurel Lingurar[:petru] from comment #27) > - In regards to a picker for "datetime / datetime-locale" please refer to > attachment 8972925 [details] > As Jan said this part is also affecting by the bug and the user cannot > select the year here also. He can just scroll until he gets to the desired > date. > AFAIK Android does not allow a built-in widget for allowing users to select > date and time at the same time. > > This is why I think we should port the DatePicker widget in our code for > DateTimePicker to allow selecting the year also and basically get the UX > that Chrome offers. > And also maybe change the color scheme.. We should be able to turn the calendar view off and replace it by a set of spinners for the date by simply using the toggleCalendar() method provided by our DateTimePicker implementation: https://dxr.mozilla.org/mozilla-central/rev/f877359308b17e691209e1afb7193b8e86f175ce/mobile/android/base/java/org/mozilla/gecko/widget/DateTimePicker.java#528 As for the colour scheme, I had already filed bug 1412518 for that.
Thanks for the deep analysis Petru! Is there a level of effort difference between your suggestion and Jan's?
Flags: needinfo?(petru.lingurar)
My suggestion only applies to the datetime/datetime-local input control. The plain date picker still needs replacing by the system date picker.
I went with what Jan suggested as that is the simplest solution, which will ensure future compatibility and also resembles what Chrome offers. When users will have to input "date" they will be presented with a default, platform widget which also let's them easily change the years. When users will have to input "datetime" / "datetime-local" they will be presented with spinners that allow setting all required fields.
Flags: needinfo?(petru.lingurar)
Attachment #8973166 - Flags: review?(sdaswani) → review?(michael.l.comella)
Comment on attachment 8973166 [details] Bug 1318046 - Allow inputting years for "date" and "datetime" html input types; https://reviewboard.mozilla.org/r/241660/#review248038 Thanks for the thorough explanations, screenshots, and videos, Petru – that was really helpful! I'd be lying if I said I really understood this calendar code but given the (amazingly thorough) video, these changes seem reasonable. Have you tested on lower API levels? We should make sure they're still working and look okay (but considering we're largely using platform components, it's probably fine). I don't think it's worth the turn-around time to fix up these nits but FYI for future reference. ::: mobile/android/base/java/org/mozilla/gecko/prompts/PromptInput.java:176 (Diff revision 1) > public DateTimeInput(GeckoBundle obj) { > super(obj); > } > > + // Will use platform's DatePicker and TimePicker to let users input date and time using the fancy widgets. > + // For the other input types our custom DateTimePicker will offer spinners. nit: it'd be good to explain why we chose to do it this way. Comments are usually reserved for explaining the why rather than the what (which the code already does). ::: mobile/android/base/java/org/mozilla/gecko/prompts/PromptInput.java:240 (Diff revision 1) > - DateTimePicker dp = (DateTimePicker)mView; > + DatePicker dp = (DatePicker) mView; > + GregorianCalendar calendar = > + new GregorianCalendar(dp.getYear(), dp.getMonth(), dp.getDayOfMonth()); > + return formatDateString("yyyy-MM-dd", calendar); > + } > + else { nit: `} else {`
Attachment #8973166 - Flags: review?(michael.l.comella) → review+
FYI: dropped the issues in Reviewboard so I could autoland it.
Pushed by michael.l.comella@gmail.com: https://hg.mozilla.org/integration/autoland/rev/ebcbcffb286f Allow inputting years for "date" and "datetime" html input types; r=mcomella
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 62
Depends on: 1460072
Depends on: 1460074
Thank you!
Depends on: 1460078
Depends on: 1460585
Depends on: 1462299
Depends on: 1464997
I have test with Firefox Nightly (Android) on ing-diba.de and open an account (https://produkte.banking.ing-diba.de/pub/girokonto-antrag-anfragen?x=smn5uvrjENvs). Here is a date "Geburtsdatum" (date of birth). There I can't scroll the years. And on the begin the color of the year is bad identifiably.
(In reply to Oswald Fischer from comment #38) > I have test with Firefox Nightly (Android) on ing-diba.de and open an > account > (https://produkte.banking.ing-diba.de/pub/girokonto-antrag- > anfragen?x=smn5uvrjENvs). Here is a date "Geburtsdatum" (date of birth). > There I can't scroll the years. And on the begin the color of the year is > bad identifiably. Vision is 62.0a1 on moto G5 plus
(In reply to Oswald Fischer from comment #38) > I have test with Firefox Nightly (Android) on ing-diba.de and open an > account > (https://produkte.banking.ing-diba.de/pub/girokonto-antrag- > anfragen?x=smn5uvrjENvs). Here is a date "Geburtsdatum" (date of birth). > There I can't scroll the years. And on the begin the color of the year is > bad identifiably. I assume you're seeing what I've been seeing in bug 1460074? As for the colour scheme, see bug 1412518.
(In reply to Jan Henning [:JanH] from comment #40) > (In reply to Oswald Fischer from comment #38) > > I have test with Firefox Nightly (Android) on ing-diba.de and open an > > account > > (https://produkte.banking.ing-diba.de/pub/girokonto-antrag- > > anfragen?x=smn5uvrjENvs). Here is a date "Geburtsdatum" (date of birth). > > There I can't scroll the years. And on the begin the color of the year is > > bad identifiably. > > I assume you're seeing what I've been seeing in bug 1460074? As for the > colour scheme, see bug 1412518. Web: go on https://produkte.banking.ing-diba.de/pub/girokonto-antrag-anfragen?x=smn5uvrjENvs an click on "Konto eröffnen".
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: