1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-15 10:46:32 +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 () { render () {
if (this.state.isLoading) { if (this.state.isLoading) {
return <div styleName='root--loading'> return <div styleName='root--loading'>
@@ -194,7 +200,7 @@ class InitModal extends React.Component {
return ( return (
<div styleName='root' <div styleName='root'
tabIndex='-1' tabIndex='-1'
onKeyDown={this.props.close} onKeyDown={(e) => this.handleKeyDown(e)}
> >
<div styleName='header'> <div styleName='header'>