react-redux-toastr
Advanced tools
Comparing version 4.4.1 to 4.4.2
@@ -66,2 +66,3 @@ 'use strict'; | ||
this.hasClicked = false; | ||
this.confirmHolder.focus(); | ||
@@ -71,15 +72,4 @@ if (this.props.confirm.show) { | ||
} | ||
if (window) { | ||
window.addEventListener('keyup', this.handleOnKeyUp); | ||
window.addEventListener('keydown', this.handleOnKeyDown); | ||
} | ||
}; | ||
ToastrConfirm.prototype.componentWillUnmount = function componentWillUnmount() { | ||
if (window) { | ||
window.removeEventListener('keyup', this.handleOnKeyUp); | ||
window.removeEventListener('keydown', this.handleOnKeyDown); | ||
} | ||
}; | ||
ToastrConfirm.prototype.handleOnKeyDown = function handleOnKeyDown(e) { | ||
@@ -168,3 +158,11 @@ if ((0, _utils.keyCode)(e) == ENTER) { | ||
'div', | ||
{ className: 'confirm-holder' }, | ||
{ | ||
className: 'confirm-holder', | ||
tabIndex: '-1', | ||
ref: function ref(_ref2) { | ||
return _this4.confirmHolder = _ref2; | ||
}, | ||
onKeyDown: this.handleOnKeyDown, | ||
onKeyUp: this.handleOnKeyUp | ||
}, | ||
_react2.default.createElement( | ||
@@ -171,0 +169,0 @@ 'div', |
{ | ||
"name": "react-redux-toastr", | ||
"version": "4.4.1", | ||
"version": "4.4.2", | ||
"description": "react-redux-toastr is a React toastr message implemented with Redux", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -37,2 +37,3 @@ import React, {Component, PropTypes} from 'react'; | ||
this.hasClicked = false; | ||
this.confirmHolder.focus(); | ||
@@ -42,15 +43,4 @@ if (this.props.confirm.show) { | ||
} | ||
if (window) { | ||
window.addEventListener('keyup', this.handleOnKeyUp); | ||
window.addEventListener('keydown', this.handleOnKeyDown); | ||
} | ||
} | ||
componentWillUnmount() { | ||
if (window) { | ||
window.removeEventListener('keyup', this.handleOnKeyUp); | ||
window.removeEventListener('keydown', this.handleOnKeyDown); | ||
} | ||
} | ||
handleOnKeyDown(e) { | ||
@@ -130,3 +120,9 @@ if (keyCode(e) == ENTER) { | ||
return ( | ||
<div className="confirm-holder"> | ||
<div | ||
className="confirm-holder" | ||
tabIndex="-1" | ||
ref={ref => this.confirmHolder = ref} | ||
onKeyDown={this.handleOnKeyDown} | ||
onKeyUp={this.handleOnKeyUp} | ||
> | ||
<div className="confirm animated" ref={ref => this.confirm = ref}> | ||
@@ -133,0 +129,0 @@ <div className="message">{this.props.confirm.message}</div> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
109375
2180