Skip to content

Commit

Permalink
Prevent default behavior of ESC key
Browse files Browse the repository at this point in the history
  • Loading branch information
shunjikonishi committed Mar 2, 2016
1 parent 7f631bd commit ef02e29
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 ef02e29

Please sign in to comment.