monaco-editor icon indicating copy to clipboard operation
monaco-editor copied to clipboard

Height of the Monaco Editor

Open SoftTimur opened this issue 9 years ago • 2 comments

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.

SoftTimur avatar Aug 11 '17 23:08 SoftTimur

related: #29

juventus18 avatar Aug 17 '17 22:08 juventus18

Dup of #29.

alexdima avatar Nov 07 '17 16:11 alexdima