Skip to content

Commit

Permalink
Merge pull request #2064 from riophae/patch
Browse files Browse the repository at this point in the history
refactor componentWillUnmount()
  • Loading branch information
JedWatson authored Oct 18, 2017
2 parents fa4313c + ec45b86 commit b68af1b
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 b68af1b

Please sign in to comment.