Skip to content

Commit

Permalink
[Fix] OutsideClickHandler: ensure this.childNode exists
Browse files Browse the repository at this point in the history
Closes #437.
  • Loading branch information
ljharb committed Aug 24, 2017
1 parent 4de2733 commit e330839
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/OutsideClickHandler.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ export default class OutsideClickHandler extends React.Component {
}

onOutsideClick(e) {
const isDescendantOfRoot = this.childNode.contains(e.target);
const { onOutsideClick } = this.props;
const { childNode } = this;
const isDescendantOfRoot = childNode && childNode.contains(e.target);
if (!isDescendantOfRoot) {
this.props.onOutsideClick(e);
onOutsideClick(e);
}
}

Expand Down

3 comments on commit e330839

@Skorney
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to create release version 10.1.3 which will patch version 10.1.2 with this bug fix?
The problem that we need only this patch but not ready to upgrade to version which includes DayPickerSingleDateController

@ljharb
Copy link
Member Author

@ljharb ljharb commented on e330839 Oct 26, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's pretty old, but sure, I suppose we could.

Published as v10.1.3.

@Skorney
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ljharb thank you!

Please sign in to comment.