From 94980111da8fa3cbe24cc20186b239afd41450fa Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Fri, 30 Mar 2018 23:54:41 +0200 Subject: Bug 1371111 - Open picker when input element's padding area is clicked + Bug 1341029: https://bugzilla.mozilla.org/show_bug.cgi?id=1341029 (partially - partially - fix typo in removeEventListener): https://hg.mozilla.org/mozilla-central/diff/6055065a2ed5/toolkit/content/widgets/datetimebox.xml + Bug 1410292: https://bugzilla.mozilla.org/show_bug.cgi?id=1410292 --- toolkit/content/widgets/datetimebox.xml | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/toolkit/content/widgets/datetimebox.xml b/toolkit/content/widgets/datetimebox.xml index c276265a3..c45124ef7 100644 --- a/toolkit/content/widgets/datetimebox.xml +++ b/toolkit/content/widgets/datetimebox.xml @@ -1072,6 +1072,10 @@ capture: true, mozSystemGroup: true }); + // This is to open the picker when input element is clicked (this + // includes padding area). + this.mInputElement.addEventListener("click", this, + { mozSystemGroup: true }); // This is to close the picker when input element blurs. this.mInputElement.addEventListener("blur", this, { mozSystemGroup: true }); @@ -1080,22 +1084,26 @@ { this.removeEventListener(eventName, this, { mozSystemGroup: true }); }); - this.removeEventListener("keypress", onKeyPress, { + this.removeEventListener("keypress", this, { capture: true, mozSystemGroup: true }); + this.mInputElement.removeEventListener("click", this, + { mozSystemGroup: true }); + this.mInputElement.removeEventListener("blur", this, + { mozSystemGroup: true }); + + this.mInputElement = null; ]]> @@ -1413,12 +1421,9 @@