mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
CodeEditor: Correctly fires onChange handler (#73030)
move onChange outside onEditorDidMount condition
This commit is contained in:
parent
873ebc58b4
commit
57d8997b86
@ -111,9 +111,12 @@ class UnthemedCodeEditor extends PureComponent<Props> {
|
||||
|
||||
const languagePromise = this.loadCustomLanguage();
|
||||
|
||||
if (onChange) {
|
||||
editor.getModel()?.onDidChangeContent(() => onChange(editor.getValue()));
|
||||
}
|
||||
|
||||
if (onEditorDidMount) {
|
||||
languagePromise.then(() => onEditorDidMount(editor, monaco));
|
||||
editor.getModel()?.onDidChangeContent(() => onChange?.(editor.getValue()));
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user