1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +00:00

esc to close modal

This commit is contained in:
Dick Choi
2016-07-23 15:45:21 +09:00
parent 286739f770
commit 1ff33378e1
3 changed files with 39 additions and 4 deletions

View File

@@ -81,9 +81,18 @@ class NewNoteModal extends React.Component {
}
}
handleKeyDown (e) {
if (e.keyCode === 27) {
this.props.close()
}
}
render () {
return (
<div styleName='root'>
<div styleName='root'
tabIndex='-1'
onKeyDown={(e) => this.handleKeyDown(e)}
>
<div styleName='header'>
<div styleName='title'>New Note</div>
</div>