fix(StatelessDialog.web): Fixes stealing Enter events

This commit is contained in:
yanas 2017-06-28 14:58:44 -05:00 committed by virtuacoplenny
parent 6fc1a3f45d
commit 47b6166d79
1 changed files with 6 additions and 0 deletions

View File

@ -268,6 +268,12 @@ class StatelessDialog extends Component {
* @returns {void}
*/
_onKeyDown(event) {
// If the event coming to the dialog has been subject to preventDefault
// we don't handle it here.
if (event.defaultPrevented) {
return;
}
if (event.key === 'Enter') {
if (this.props.submitDisabled && !this.props.cancelDisabled) {
this._onCancel();