mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-14 02:06:29 +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:
@@ -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'>
|
||||||
|
|||||||
Reference in New Issue
Block a user