Skip to content

Commit

Permalink
fix(date-picker): close range datepicker after clicking elsewhere on …
Browse files Browse the repository at this point in the history
…page
  • Loading branch information
rezak-otmani authored and alisonjoseph committed Jun 18, 2018
1 parent cedfbd1 commit c978c4f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/date-picker/date-picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<input>`s or our latest setup with a hidden `<input>`
Expand Down

0 comments on commit c978c4f

Please sign in to comment.