diff --git a/toolkit/content/widgets/datetimebox.xml b/toolkit/content/widgets/datetimebox.xml index c276265a3d..c45124ef74 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 @@