CodeEditor: Correctly fires onChange handler (#73030)

move onChange outside onEditorDidMount condition
This commit is contained in:
Ashley Harrison 2023-08-15 09:19:14 +01:00 committed by GitHub
parent 873ebc58b4
commit 57d8997b86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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()));
}
};