monaco-editor
monaco-editor copied to clipboard
Height of the Monaco Editor
I am still struggling with the height of a Monaco Editor, the behaviour is quite different from CodeMirror or ACE.
I want to make a very simple Monaco Editor: JSBin:
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<style>
.me {
height: 100vh;
}
</style>
</head>
<body>
<div class="me" id="container"></div>
<script src="https://www.matrixlead.com/monaco-editor/min/vs/loader.js"></script>
<script>
require.config({ paths: { 'vs': 'https://www.matrixlead.com/monaco-editor/min/vs' }})
require(["vs/editor/editor.main"], function () {
var editor = monaco.editor.create(document.getElementById('container'), {
value: 'function x() {\n\tconsole.log("Hello world!");\n}',
language: 'javascript',
minimap: { enabled: false },
scrollBeyondLastLine: false
});
});
</script>
</body>
</html>
When I see it in Chrome and scroll up and down, there is a scroller for the whole window. It seems that it is because the height of the editor is larger than the height of the window. I just don't want to see any scrollers. Does anyone know how to achieve this?
Thank you.
related: #29
Dup of #29.