Skip to content

Commit

Permalink
fix: Remove event listner on unmount 🐛 (#182)
Browse files Browse the repository at this point in the history
Fixes #180
  • Loading branch information
mrchief committed Oct 5, 2018
1 parent 7c96f1f commit bab7df6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/bundle.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ class DropdownTreeSelect extends Component {
this.setState({ tree, tags })
}

componentWillUnmount() {
document.removeEventListener('click', this.handleOutsideClick, false)
}

componentWillReceiveProps(nextProps) {
const tree = this.createList(nextProps.data, nextProps.simpleSelect, nextProps.showPartiallySelected)
const tags = this.treeManager.getTags()
Expand Down

0 comments on commit bab7df6

Please sign in to comment.