close writedataform on escape
parent
8e0bd25f49
commit
62ce1d3b7a
|
@ -13,6 +13,7 @@ class WriteDataForm extends Component {
|
|||
this.handleSelectDatabase = ::this.handleSelectDatabase
|
||||
this.handleWrite = ::this.handleWrite
|
||||
this.handleClickOutside = ::this.handleClickOutside
|
||||
this.handleKeyUp = ::this.handleKeyUp
|
||||
}
|
||||
|
||||
handleSelectDatabase(item) {
|
||||
|
@ -24,6 +25,14 @@ class WriteDataForm extends Component {
|
|||
onClose()
|
||||
}
|
||||
|
||||
handleKeyUp(e) {
|
||||
const escapeKeyCode = 27
|
||||
if (e.which === escapeKeyCode) {
|
||||
const {onClose} = this.props
|
||||
onClose()
|
||||
}
|
||||
}
|
||||
|
||||
handleWrite() {
|
||||
const {onClose, source, writeData} = this.props
|
||||
const {selectedDatabase} = this.state
|
||||
|
@ -56,6 +65,8 @@ class WriteDataForm extends Component {
|
|||
spellCheck="false"
|
||||
placeholder="<measurement>,<tag_key>=<tag_value> <field_key>=<field_value>"
|
||||
ref={editor => this.editor = editor}
|
||||
onKeyUp={this.handleKeyUp}
|
||||
autoFocus={true}
|
||||
/>
|
||||
<span>
|
||||
Uses InfluxDB Line Protocol -
|
||||
|
|
Loading…
Reference in New Issue