1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-14 10:16:26 +00:00

fix anykey can close the initmodal issue

this change makes only ESC key can close the initmodal window.
This commit is contained in:
yosmoc
2017-11-25 23:39:59 +01:00
parent 6b6a415dd5
commit eec22e6b7d

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'>