Skip to content

Commit 33b69f2

Browse files
authored
fix: Remove event listner on unmount 🐛 (dowjones#182)
Fixes dowjones#180
1 parent 7c96f1f commit 33b69f2

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

docs/bundle.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.js

+4
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ class DropdownTreeSelect extends Component {
7272
this.setState({ tree, tags })
7373
}
7474

75+
componentWillUnmount() {
76+
document.removeEventListener('click', this.handleOutsideClick, false)
77+
}
78+
7579
componentWillReceiveProps(nextProps) {
7680
const tree = this.createList(nextProps.data, nextProps.simpleSelect, nextProps.showPartiallySelected)
7781
const tags = this.treeManager.getTags()

0 commit comments

Comments
 (0)