-
Notifications
You must be signed in to change notification settings - Fork 370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cannot call editor.setValue
in editorDidMount
#685
Comments
Believe we're running into the same issue. Any progress? |
Can also confirm [email protected] does not have this issue and works as expected. I would also like to point out |
I switched to use https://github.com/suren-atoyan/monaco-react, it works well. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
I run the latest example in react-monaco-editor (8dba5e3, [email protected]).
It can not set editor content in editorDidMount.
To Reproduce
([email protected], [email protected])
Clone react-monaco-editor repo and cd the example directory. change
editorDidMount
in classCodeEditor
to:editorDidMount = (editor) => { // eslint-disable-next-line no-console console.log("editorDidMount", editor, editor.getValue(), editor.getModel()); this.editor = editor; + editor.setValue("// new value"); };
The editor ui does not change to "// new value".
But if we switch to ([email protected] and [email protected]), it works well (can show "// new value").
Expected behavior
It can show "// new value" under [email protected].
Screenshots/Logs
Environment (please complete the following information):
OS: MacOS 13.1 (22C65)
Browser: Firefox 108.0.1
Bundler: webpack
I will try to send a pull request to fix this issue.
The text was updated successfully, but these errors were encountered: