Skip to content

Commit

Permalink
Merge pull request JedWatson#1265 from strayiker/master
Browse files Browse the repository at this point in the history
IE8 compatibility fixes
  • Loading branch information
JedWatson authored Oct 1, 2016
2 parents 0b36224 + f9039c7 commit b3db918
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,26 @@ const Select = React.createClass({
},

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

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

Expand Down Expand Up @@ -857,7 +869,7 @@ const Select = React.createClass({

if (this.props.autosize) {
return (
<AutosizeInput {...inputProps} minWidth="5px" />
<AutosizeInput {...inputProps} minWidth="5" />
);
}
return (
Expand Down

0 comments on commit b3db918

Please sign in to comment.