From de16d196679e3deaf8797abcc05db5cf0ead6ae8 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Sat, 31 Mar 2018 06:58:52 +0200 Subject: Bug 1401876 - (Part 1) Close datetime picker on popuphidden --- toolkit/content/tests/browser/head.js | 1 + toolkit/content/widgets/datetimepopup.xml | 2 +- toolkit/modules/DateTimePickerHelper.jsm | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) (limited to 'toolkit') diff --git a/toolkit/content/tests/browser/head.js b/toolkit/content/tests/browser/head.js index e3ef19538..399b63e34 100644 --- a/toolkit/content/tests/browser/head.js +++ b/toolkit/content/tests/browser/head.js @@ -99,6 +99,7 @@ class DateTimeTestHelper { let pickerClosePromise = new Promise(resolve => { this.panel.addEventListener("popuphidden", resolve, {once: true}); }); + this.panel.hidePopup(); this.panel.closePicker(); await pickerClosePromise; } diff --git a/toolkit/content/widgets/datetimepopup.xml b/toolkit/content/widgets/datetimepopup.xml index 1cb9617ea..b4335e1ce 100644 --- a/toolkit/content/widgets/datetimepopup.xml +++ b/toolkit/content/widgets/datetimepopup.xml @@ -70,7 +70,6 @@ this.dateTimePopupFrame.removeEventListener("load", this, true); this.dateTimePopupFrame.contentDocument.removeEventListener("message", this, false); this.dateTimePopupFrame.setAttribute("src", ""); - this.hidePopup(); this.hidden = true; ]]> @@ -302,6 +301,7 @@ break; } case "ClosePopup": { + this.hidePopup(); this.closePicker(); break; } diff --git a/toolkit/modules/DateTimePickerHelper.jsm b/toolkit/modules/DateTimePickerHelper.jsm index 0ea96f226..5a18cb5fb 100644 --- a/toolkit/modules/DateTimePickerHelper.jsm +++ b/toolkit/modules/DateTimePickerHelper.jsm @@ -91,6 +91,7 @@ this.DateTimePickerHelper = { if (browser) { browser.messageManager.sendAsyncMessage("FormDateTime:PickerClosed"); } + this.picker.closePicker(); this.close(); break; } -- cgit v1.2.3