Skip to content
Snippets Groups Projects
Unverified Commit 4be64a82 authored by Ariya Hidayat's avatar Ariya Hidayat Committed by GitHub
Browse files

Custom expression editor: avoid null ref (#19586)

Seems that the very first focus happens when the element ref isn't ready
yet (the component did not completely get mounted).
parent 5bb44a6e
No related branches found
No related tags found
No related merge requests found
......@@ -231,8 +231,10 @@ export default class ExpressionEditorTextfield extends React.Component {
handleFocus = () => {
this.setState({ isFocused: true });
const { editor } = this.input.current;
this.handleCursorChange(editor.selection);
if (this.input.current) {
const { editor } = this.input.current;
this.handleCursorChange(editor.selection);
}
};
handleInputBlur = e => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment