How to make editor autoresizable
See original GitHub issueIn the IEditorConstructionOptions
has a property called automaticLayout
, that enables autoresize
as commented here
https://stackoverflow.com/questions/49923334/how-to-make-monaco-editor-auto-fit-content-like-codemirror-auto-resize-mode
how can i pass this boolean property in react component? and will this override the default sizes passed in the monaco-react component?
Issue Analytics
- State:
- Created 3 years ago
- Comments:19 (7 by maintainers)
Top Results From Across the Web
Monaco editor dynamically resizable - Stack Overflow
Monaco has a built-in auto resize to parent container functionality: createEditorWithAutoResize(){ this.editor = monaco.editor.create( this.
Read more >Resizing Customization - CKEditor 4 Documentation
To achieve this, use the editor.resize() method to define the dimensions of the editor interface, assigning the window a width and height value...
Read more >Autoresize plugin | Docs - TinyMCE
Automatically resize TinyMCE to fit content. ... This plugin automatically resizes the editor to the content inside it. It is typically used to...
Read more >Is there a better way of auto resizing the grid pop up editor?
4) On the auto resize re-center the popup editor. I guess what I am trying to do is make this as "responsive" as...
Read more >Autoresize Demo - CodeMirror
By setting an editor's height style to auto and giving the viewportMargin a value of Infinity , CodeMirror can be made to automatically...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
There is a way to do this, This solution comes from an issue in monaco https://github.com/microsoft/monaco-editor/issues/794. https://codesandbox.io/s/empty-dust-h6z4y?file=/src/App.js
The editor will not resize after its initialization because the child elements are setting a static width based on the init.
Component:
Rendered Html of monaco-react parent sections:
Cut off monaco editor display:
Please let me know if more information is needed.