Skip to content
Snippets Groups Projects
Commit 01a250e5 authored by KDSBrowne's avatar KDSBrowne
Browse files

fix console error with FindDOMNode() on unmounted component

parent ae883f10
No related branches found
No related tags found
No related merge requests found
......@@ -105,13 +105,15 @@ class Dropdown extends Component {
}
handleWindowClick(event) {
const dropdownElement = findDOMNode(this);
const shouldUpdateState = event.target !== dropdownElement &&
if(this.state.isOpen){
const dropdownElement = findDOMNode(this);
const shouldUpdateState = event.target !== dropdownElement &&
!dropdownElement.contains(event.target) &&
this.state.isOpen;
if (shouldUpdateState) {
this.handleHide();
if (shouldUpdateState) {
this.handleHide();
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment