showPicker method doesn't work on week and month input
Categories
(GeckoView :: General, defect, P1)
Tracking
(firefox120 wontfix, firefox121 fixed, firefox122 fixed)
People
(Reporter: lwarlow, Assigned: m_kato)
References
(Regression)
Details
(Keywords: dev-doc-complete, regression)
Attachments
(1 file)
|
48 bytes,
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-beta+
|
Details | Review |
User Agent: Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Mobile Safari/537.36
Steps to reproduce:
Load https://demo.lukewarlow.dev/showPicker/
Click "date showPicker", "month showPicker" and "week showPicker".
Actual results:
Only the date input picker opened.
Expected results:
All the pickers should have opened like happens when you click on the input itself.
Comment 1•2 years ago
|
||
Related code:
https://searchfox.org/mozilla-central/source/mobile/android/components/geckoview/GeckoViewPrompt.sys.mjs#67-77
From comment: it refers to bug 888320
Comment 2•2 years ago
|
||
The severity field is not set for this bug.
:jonalmeida, could you have a look please?
For more information, please visit BugBot documentation.
Comment 3•2 years ago
|
||
Once again, thank you jackyzy. :)
I'm going to close it as a duplicate for the linked bug.
| Reporter | ||
Comment 4•2 years ago
|
||
This isn't a duplicate of that? This is a very specific bug report for Firefox android. Fenix has a week and month input implemented (unlike desktop) it just doesn't have showPicker() implemented for it.
| Reporter | ||
Updated•2 years ago
|
| Reporter | ||
Comment 5•2 years ago
|
||
I've reopened this just to make absolutely sure that it's clear this is specific to Android Firefox which already has a month and week input implemented (so the linked bug would seem irrelevant).
Comment 6•2 years ago
|
||
Sorry for misleading information.
After some more digging, i found it is a regression of 1824323
Diff: https://phabricator.services.mozilla.com/D173959
Previously, in dom/html/HTMLInputElement.cpp HTMLInputElement::ShowPicker( method : it decide to show via IsDateTimeInputType(mType) , now it use CreatesDateTimeWidget() , CreatesDateTimeWidget is missing InputWeek and InputMonth
bool HTMLInputElement::IsDateTimeInputType(FormControlType aType) {
switch (aType) {
case FormControlType::InputDate:
case FormControlType::InputTime:
case FormControlType::InputMonth:
case FormControlType::InputWeek:
case FormControlType::InputDatetimeLocal:
return true;
default:
return false;
}
}
and
static bool CreatesDateTimeWidget(FormControlType aType) {
return aType == FormControlType::InputDate ||
aType == FormControlType::InputTime ||
aType == FormControlType::InputDatetimeLocal;
}
I tested on Firefox for Android 111.0 , the showPicker button works. So i suggest change condition from CreatesDateTimeWidget back to IsDateTimeInputType
Comment 7•2 years ago
|
||
Furthermore , even IsDateTimeInputType is used, MozDateTimeShowPickerForJS still not be triggered , because no shadow root , GetDateTimeBoxElement returns nullptr. https://searchfox.org/mozilla-central/source/dom/html/HTMLInputElement.cpp#5780
Since week/month cannot trigger case "MozOpenDateTimePicker" -> this._handleDateTime(aEvent.composedTarget);
So it should be handled in case "click" -> this._handleClick(aEvent); then https://searchfox.org/mozilla-central/source/mobile/android/components/geckoview/GeckoViewPrompt.sys.mjs#67-72 , but it is early returned here https://searchfox.org/mozilla-central/source/mobile/android/components/geckoview/GeckoViewPrompt.sys.mjs#41-44 because the class of element is "HTMLButtonElement" not the required "HTMLInputElement" / "HTMLSelectElement"
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
| Assignee | ||
Comment 8•1 year ago
|
||
Ah, regression. GeckoView should add gv-junit for prompt.
Comment 9•1 year ago
|
||
Set release status flags based on info from the regressing bug 1824323
| Assignee | ||
Comment 10•1 year ago
|
||
This seems to be a regression by bug 1824323. If we turn on
dom.forms.datetime.others=true, we should dispatch MozOpenDateTimePicker
event simply.
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Comment 11•1 year ago
|
||
Comment 12•1 year ago
|
||
| bugherder | ||
Comment 13•1 year ago
|
||
The patch landed in nightly and beta is affected.
:m_kato, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- If no, please set
status-firefox121towontfix.
For more information, please visit BugBot documentation.
Comment 14•1 year ago
|
||
MDN docs for showPicker say we don't support date, month, week. I can see that from 122 we will, but this is marked as a regression, so is there an earlier version where we though it worked?
| Assignee | ||
Comment 15•1 year ago
|
||
Comment on attachment 9365609 [details]
Bug 1853797 - HTMLInputElement.showPicker should show the picker on GeckoView even if type is month or week. r=#dom-core!,#geckoview-reviewers!
Beta/Release Uplift Approval Request
- User impact if declined: HTMLInputElement.showPicker for
<input type="month">or<input type="week">doesn't work from Firefox for Android version 112. - Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Low. When
typeattribute of<input>element ismonthorweek, we dispatch an chrome event that is ignored on desktop. - String changes made/needed: No
- Is Android affected?: Yes
Comment 16•1 year ago
|
||
Comment on attachment 9365609 [details]
Bug 1853797 - HTMLInputElement.showPicker should show the picker on GeckoView even if type is month or week. r=#dom-core!,#geckoview-reviewers!
Approved for 121.0b9.
Comment 17•1 year ago
|
||
| uplift | ||
Updated•1 year ago
|
| Assignee | ||
Comment 18•1 year ago
•
|
||
(In reply to Hamish Willee from comment #14)
MDN docs for showPicker say we don't support date, month, week. I can see that from 122 we will, but this is marked as a regression, so is there an earlier version where we though it worked?
It works from version 101 to version 112. It was broken from 113.
Comment 19•1 year ago
|
||
Thanks very much. Just to be clear, is this Android-only, or "Android as well"? I have updated https://github.com/mdn/browser-compat-data/pull/21577 as draft assuming these work everywhere.
Note, on 122.0a1 nightly FF build the selection lists don't work for me on desktop for month or week, which is why I ask. Might not be in that build yet I guess.
| Reporter | ||
Comment 20•1 year ago
|
||
Android only and to be clear this is only relevant for the showPicker function.
Updated•1 year ago
|
Updated•1 year ago
|
Description
•