I am working on a Monaco editor to automatically trigger scroll events. So far example if I press 'a' then it will automatically trigger scrolling until another key is pressed. The code works fine in a plain html page but when monaco editor is used it is not working. This is the code in jsfiddle.
var speed = 100;
function pageScroll() {
if(speed == 0) return;
document.getElementById("container").scrollBy(0,50);
setTimeout('pageScroll()',speed);
}
Full code on jsfiddle
Can anyone suggest me what's wrong with the code.