From 3c13fc5f2de3b843fd20b6786c6bcad90ac9d2d9 Mon Sep 17 00:00:00 2001 From: Rezak OTMANI Date: Mon, 11 Jun 2018 16:04:23 +0200 Subject: [PATCH] fix(date-picke): close range datepicker after clicking elsewhere on page, resolves #772 --- src/components/date-picker/date-picker.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/date-picker/date-picker.js b/src/components/date-picker/date-picker.js index dceefb7f6484..2696c349bdfc 100644 --- a/src/components/date-picker/date-picker.js +++ b/src/components/date-picker/date-picker.js @@ -130,6 +130,9 @@ class DatePicker extends mixin(createComponent, initComponentBySearch, handles) const focusoutEventName = hasFocusout ? 'focusout' : 'blur'; this.manage(on(this.element, focusinEventName, this._handleFocus, !hasFocusin)); this.manage(on(this.element, focusoutEventName, this._handleBlur, !hasFocusout)); + this.manage( + on(this.element.querySelector(this.options.selectorDatePickerIcon), focusoutEventName, this._handleBlur, !hasFocusout) + ); // An attempt to disable Flatpickr's focus tracking system, // which has adverse effect with our old set up with two ``s or our latest setup with a hidden ``