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