We use scrollIntoView()
to jump to a line of code and bring it to the top of the editor viewport. Is it possible to make that jump slower and smoother, similar to the JS equivalent on the DOM? I.e.: element.scrollIntoView({behavior: "smooth", block: "start", inline: "nearest"});
, noting the behavior: "smooth"
and block: "start"
in particular. See Element.scrollIntoView() - Web APIs | MDN
We can kind of work out some math to get the top alignment (but a built-in option for this would be easier if we missed it). However for the smooth scrolling we are really struggling. Any advice?