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

Scroll event is not propagating to parent

Open yln99517 opened this issue 6 years ago • 2 comments

monaco-editor version: 0.20.0 Browser: OS: Playground code that reproduces the issue: go here - https://microsoft.github.io/monaco-editor/

Scroll the editor using mouse. Once editor is scrolled to end ( horizontal or vertical ), page should scroll but that is not happening.

yln99517 avatar Jun 14 '20 13:06 yln99517

Achieving scroll parent( or any scroll listener in the DOM hierarchy) after the editor scrolling reaches the end of the document is fairly simple:

monaco.editor.create(document.getElementById("container"), {
	value: "function hello() {\n\talert('Hello world!');\n}",
	language: "javascript",
    scrollbar:{
        alwaysConsumeMouseWheel: false, // defaults is true, false enables the behavior you describe
    }
});

This HTML is just to showcase the behavior:

<div id="container" style="height:100%;"><div style="height:50%;"><div id="container" style="height:100%;"></div></div></div>

Interesting observation, the behavior should be as you mentioned, otherwise provide scroll end feedback like the bouncy scroll end browser like Chrome does.

luminaxster avatar Jun 15 '20 22:06 luminaxster

This solved my issue. Thank you

yln99517 avatar Jun 16 '20 05:06 yln99517