1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

Merge pull request #1176 from yosmoc/initmodal_exit_fix

fix anykey can close the initmodal window issue
This commit is contained in:
Kazz Yokomizo
2017-11-26 16:05:38 +09:00
committed by GitHub

View File

@@ -184,6 +184,12 @@ class InitModal extends React.Component {
})
}
handleKeyDown (e) {
if (e.keyCode === 27) {
this.props.close()
}
}
render () {
if (this.state.isLoading) {
return <div styleName='root--loading'>
@@ -194,7 +200,7 @@ class InitModal extends React.Component {
return (
<div styleName='root'
tabIndex='-1'
onKeyDown={this.props.close}
onKeyDown={(e) => this.handleKeyDown(e)}
>
<div styleName='header'>