From ef02e293fbabf20cf0652a2045012e5fe43cca06 Mon Sep 17 00:00:00 2001 From: Shunji Konishi Date: Wed, 2 Mar 2016 14:25:42 +0900 Subject: [PATCH] Prevent default behavior of ESC key --- lib/components/ModalPortal.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/components/ModalPortal.js b/lib/components/ModalPortal.js index b7db99c7..dcbfe8a3 100644 --- a/lib/components/ModalPortal.js +++ b/lib/components/ModalPortal.js @@ -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() {