diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-03-31 07:07:45 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-03-31 07:07:45 +0200 |
commit | 09cc05a97f387d2342ad49c64d66da0b0b9ae7e7 (patch) | |
tree | 753b7673d6ce42b2b6e19b04a9fced1bcddfd2b7 | |
parent | 0a2b11d18138283e5fd1520e1230451f2e41a0c9 (diff) | |
download | UXP-09cc05a97f387d2342ad49c64d66da0b0b9ae7e7.tar UXP-09cc05a97f387d2342ad49c64d66da0b0b9ae7e7.tar.gz UXP-09cc05a97f387d2342ad49c64d66da0b0b9ae7e7.tar.lz UXP-09cc05a97f387d2342ad49c64d66da0b0b9ae7e7.tar.xz UXP-09cc05a97f387d2342ad49c64d66da0b0b9ae7e7.zip |
Bug 1406859 - [DateTimePicker] Let the first picker close gracefully before opening a second picker
-rw-r--r-- | toolkit/content/browser-content.js | 8 | ||||
-rw-r--r-- | toolkit/modules/DateTimePickerHelper.jsm | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/toolkit/content/browser-content.js b/toolkit/content/browser-content.js index 145de9608..1376f70a3 100644 --- a/toolkit/content/browser-content.js +++ b/toolkit/content/browser-content.js @@ -1714,6 +1714,14 @@ let DateTimePickerListener = { (aEvent.originalTarget.type == "time" && !this.getTimePickerPref())) { return; } + + if (this._inputElement) { + // This happens when we're trying to open a picker when another picker + // is still open. We ignore this request to let the first picker + // close gracefully. + return; + } + this._inputElement = aEvent.originalTarget; this._inputElement.setDateTimePickerState(true); this.addListeners(); diff --git a/toolkit/modules/DateTimePickerHelper.jsm b/toolkit/modules/DateTimePickerHelper.jsm index 5a18cb5fb..b509742b0 100644 --- a/toolkit/modules/DateTimePickerHelper.jsm +++ b/toolkit/modules/DateTimePickerHelper.jsm @@ -64,6 +64,7 @@ this.DateTimePickerHelper = { return; } this.picker.closePicker(); + this.close(); break; } case "FormDateTime:UpdatePicker": { |