Skip to content

Commit

Permalink
Merge pull request reactjs#132 from shunjikonishi/shunjikonishi-patch-1
Browse files Browse the repository at this point in the history
[Fixed] Prevent default behavior of ESC key
  • Loading branch information
claydiffrient committed Mar 24, 2016
2 parents bc58b9c + ef02e29 commit 980ad5d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/components/ModalPortal.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ var ModalPortal = module.exports = React.createClass({

handleKeyDown: function(event) {
if (event.keyCode == 9 /*tab*/) scopeTab(this.refs.content, event);
if (event.keyCode == 27 /*esc*/) this.requestClose();
if (event.keyCode == 27 /*esc*/) {
event.preventDefault();
this.requestClose();
}
},

handleOverlayClick: function() {
Expand Down

0 comments on commit 980ad5d

Please sign in to comment.