Skip to content

Commit 980ad5d

Browse files
committedMar 24, 2016
Merge pull request #132 from shunjikonishi/shunjikonishi-patch-1
[Fixed] Prevent default behavior of ESC key
2 parents bc58b9c + ef02e29 commit 980ad5d

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)