react-modal-bootstrap
react-modal-bootstrap copied to clipboard
IE8 does not have addEventListener and removeEventListner
Can you change the Modal to replace addEventListener to attachEvent, and removeEventListener to detachEvent, so that the modal can work well on IE8?
this.componentDidMount = function () {
if(document.addEventListener){
document.addEventListener('keydown', _this.handleKeyDown);
}else{
document.attachEvent('onkeydown', _this.handleKeyDown);
}
_this.handleBody();
_this.handleParent();
};
this.componentWillUnmount = function () {
if(document.removeEventListener){
document.removeEventListener('keydown', _this.handleKeyDown);
}else{
document.detachEvent('onkeydown', _this.handleKeyDown);
}
};