Skip to content

Commit ef02e29

Browse files
committed
Prevent default behavior of ESC key
1 parent 7f631bd commit ef02e29

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: lib/components/ModalPortal.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,10 @@ var ModalPortal = module.exports = React.createClass({
142142

143143
handleKeyDown: function(event) {
144144
if (event.keyCode == 9 /*tab*/) scopeTab(this.refs.content, event);
145-
if (event.keyCode == 27 /*esc*/) this.requestClose();
145+
if (event.keyCode == 27 /*esc*/) {
146+
event.preventDefault();
147+
this.requestClose();
148+
}
146149
},
147150

148151
handleOverlayClick: function() {

0 commit comments

Comments
 (0)