From eec22e6b7da6738ce367fa25036b987ea8bbc7fd Mon Sep 17 00:00:00 2001 From: yosmoc Date: Sat, 25 Nov 2017 23:39:59 +0100 Subject: [PATCH] fix anykey can close the initmodal issue this change makes only ESC key can close the initmodal window. --- browser/main/modals/InitModal.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/browser/main/modals/InitModal.js b/browser/main/modals/InitModal.js index b8a94cf4..45a8746c 100644 --- a/browser/main/modals/InitModal.js +++ b/browser/main/modals/InitModal.js @@ -184,6 +184,12 @@ class InitModal extends React.Component { }) } + handleKeyDown (e) { + if (e.keyCode === 27) { + this.props.close() + } + } + render () { if (this.state.isLoading) { return
@@ -194,7 +200,7 @@ class InitModal extends React.Component { return (
this.handleKeyDown(e)} >