diff --git a/CHANGELOG.md b/CHANGELOG.md index 49820c03918..5d8e0139f64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ ### UI Improvements 1. [12782](https://github.com/influxdata/influxdb/pull/12782): Move bucket selection in the query builder to the first card in the list +1. [12850](https://github.com/influxdata/influxdb/pull/12850): Ensure editor is automatically focused in note editor ## v2.0.0-alpha.6 [2019-03-15] diff --git a/ui/src/dashboards/components/NoteEditorText.tsx b/ui/src/dashboards/components/NoteEditorText.tsx index 4637f0828d5..a0dd445515c 100644 --- a/ui/src/dashboards/components/NoteEditorText.tsx +++ b/ui/src/dashboards/components/NoteEditorText.tsx @@ -1,6 +1,6 @@ // Libraries import React, {PureComponent} from 'react' -import {Controlled as ReactCodeMirror} from 'react-codemirror2' +import {Controlled as ReactCodeMirror, IInstance} from 'react-codemirror2' // Utils import {humanizeNote} from 'src/dashboards/utils/notes' @@ -35,10 +35,15 @@ class NoteEditorText extends PureComponent { options={OPTIONS} onBeforeChange={this.handleChange} onTouchStart={noOp} + editorDidMount={this.handleMount} /> ) } + private handleMount = (instance: IInstance) => { + instance.focus() + } + private handleChange = (_, __, note: string) => { const {onChangeNote} = this.props