diff --git a/ui/src/dashboards/components/CellEditorOverlay.js b/ui/src/dashboards/components/CellEditorOverlay.js index 201b1b14e5..e3539217fd 100644 --- a/ui/src/dashboards/components/CellEditorOverlay.js +++ b/ui/src/dashboards/components/CellEditorOverlay.js @@ -60,8 +60,6 @@ class CellEditorOverlay extends Component { axes, colorSingleStatText: colorsTypeContainsText, colors: validateColors(colors, type, colorsTypeContainsText), - metaKeyDown: false, - enterKeyDown: false, } } @@ -449,28 +447,8 @@ class CellEditorOverlay extends Component { } handleHotKeyDown = e => { - if (e.key === 'Meta') { - this.setState({metaKeyDown: true}) - } - if (e.key === 'Enter') { - this.setState({enterKeyDown: true}) - } - } - - handleHotKeyUp = e => { - if (e.key === 'Meta') { - this.setState({metaKeyDown: false}) - - if (this.state.enterKeyDown === true && e.target === this.overlayRef) { - this.handleSaveCell() - } - } - if (e.key === 'Enter') { - this.setState({enterKeyDown: false}) - - if (this.state.metaKeyDown === true && e.target === this.overlayRef) { - this.handleSaveCell() - } + if (e.key === 'Enter' && e.metaKey && e.target === this.overlayRef) { + this.handleSaveCell() } if (e.key === 'Escape' && e.target === this.overlayRef) { this.props.onCancel() @@ -510,7 +488,6 @@ class CellEditorOverlay extends Component {
(this.overlayRef = r)} >