Closed Bug 1443958 Opened 6 years ago Closed 6 years ago

Synthesizing a click() on input type=date should not show the date picker UI

Categories

(Core :: DOM: Core & HTML, defect, P2)

60 Branch
defect

Tracking

()

RESOLVED FIXED
mozilla61
Tracking Status
firefox60 --- fixed
firefox61 --- fixed

People

(Reporter: miketaylr, Assigned: smaug)

References

()

Details

(Whiteboard: [webcompat:p1])

User Story

Business driver: Achieve tier-1 Google Search experience for Gecko on Android

Attachments

(1 file, 1 obsolete file)

Per https://github.com/whatwg/html/issues/3232, Firefox is the only browser that allows dispatching a synthetic click event to open the date picker UI:

Here's a simple test case:

https://output.jsbin.com/sonopow/quiet

We should match the other major browsers behavior here, for interop.
Flags: webcompat+
Whiteboard: [webcompat:p2]
Setting to [webcompat:p1] because this affects Google Tier 1 Search.
Whiteboard: [webcompat:p2] → [webcompat:p1]
Priority: -- → P2
Component: DOM: Events → DOM: Core & HTML
This is trivial, at least on desktop. And doesn't seem to apply to mobile.
Assignee: nobody → bugs
Attached patch date_click.diff (obsolete) — Splinter Review
This is a very small patch :)

remote: View your change here:
remote:   https://hg.mozilla.org/try/rev/2bc9d7050b66ef4d34abccefcc953f0aff3e4e2b
remote: 
remote: Follow the progress of your build on Treeherder:
remote:   https://treeherder.mozilla.org/#/jobs?repo=try&revision=2bc9d7050b66ef4d34abccefcc953f0aff3e4e2b
remote: recorded changegroup in replication log in 0.095s
Attachment #8963725 - Flags: review?(mconley)
Comment on attachment 8963725 [details] [diff] [review]
date_click.diff

Review of attachment 8963725 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks!

::: toolkit/content/widgets/datetimebox.xml
@@ +1255,5 @@
>          // Handle keypress separately since we need to catch it on capturing.
>          this.addEventListener("keypress", this, {
>            capture: true,
>            mozSystemGroup: true
> +        },

Nit - I think it's usually more common to have these on the same line, like:

this.addEventListener("keypress", this, {
  capture: true,
  mozSystemGroup: true,
}, false);
Attachment #8963725 - Flags: review?(mconley) → review+
Pushed by opettay@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/223010e3a593
Synthesizing a click() on input type=date should not show the date picker UI , r=mconley
https://hg.mozilla.org/mozilla-central/rev/223010e3a593
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
Should we get this on 60 to avoid webcompat pain on esr?
Flags: needinfo?(bugs)
I don't know. The patch should be quite safe anyhow.

Mike may have an opinion.
Flags: needinfo?(bugs) → needinfo?(miket)
Yes, it seems like a good idea, if possible.
Flags: needinfo?(miket)
ok, let me try whether the patches apply to 60
There doesn't seem to have a flag yet for esr60 approval.

The patch itself seems to apply.
Flags: needinfo?(jcristau)
There is, it's called "approval-mozilla-beta" :)
Flags: needinfo?(jcristau)
Comment on attachment 8963821 [details] [diff] [review]
date_click_2.diff

Approval Request Comment
[Feature/Bug causing the regression]: This has been an issue since we added support for type=date
[User impact if declined]: different behavior than in other browsers
[Is this code covered by automated tests?]: yes
[Has the fix been verified in Nightly?]: yes by tests
[Needs manual test from QE? If yes, steps to reproduce]: I don't think manual test is needed 
[List of other uplifts needed for the feature/fix]: NA
[Is the change risky?]: shouldn't be too risky.
[Why is the change risky/not risky?]: we end up handling trusted-only events like other similar element implementations
[String changes made/needed]: NA
Attachment #8963821 - Flags: approval-mozilla-beta?
Comment on attachment 8963821 [details] [diff] [review]
date_click_2.diff

let's get this in 60.0b11
Attachment #8963821 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #8963725 - Attachment is obsolete: true
User Story: (updated)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: