Skip to content

Commit

Permalink
refactor componentWillUnmount()
Browse files Browse the repository at this point in the history
  • Loading branch information
riophae committed Oct 15, 2017
1 parent 7523c20 commit ec45b86
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,7 @@ class Select extends React.Component {
}

componentWillUnmount () {
if (!document.removeEventListener && document.detachEvent) {
document.detachEvent('ontouchstart', this.handleTouchOutside);
} else {
document.removeEventListener('touchstart', this.handleTouchOutside);
}
this.toggleTouchOutsideEvent(false);
}

toggleTouchOutsideEvent (enabled) {
Expand Down

0 comments on commit ec45b86

Please sign in to comment.