Skip to content

Commit

Permalink
Fix DateInput under Internet Explorer 11
Browse files Browse the repository at this point in the history
  • Loading branch information
gjvoosten committed Apr 9, 2019
1 parent 44043fd commit c6bf8d7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/datetime/src/dateInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,13 @@ export class DateInput extends AbstractPureComponent<IDateInputProps, IDateInput

// focus DOM event listener (not React event)
private handlePopoverBlur = (e: FocusEvent) => {
const relatedTarget = e.relatedTarget as HTMLElement;
if (relatedTarget == null || !this.popoverContentEl.contains(relatedTarget)) {
let relatedTarget = e.relatedTarget as HTMLElement;
if (relatedTarget == null) {
// Support IE11 (#2924)
relatedTarget = document.activeElement as HTMLElement;
}
// Beware: this.popoverContentEl is sometimes null under Chrome
if (relatedTarget == null || (this.popoverContentEl != null && !this.popoverContentEl.contains(relatedTarget))) {
this.handleClosePopover();
} else if (relatedTarget != null) {
this.unregisterPopoverBlurHandler();
Expand Down

0 comments on commit c6bf8d7

Please sign in to comment.