Use scrollRectIntoView to ensure a specific rectangular area is visible within the editor's viewport. It traverses up the DOM tree from a starting node (or the editor itself) to find scrollable containers and adjusts their scrollTop and scrollLeft properties.
This function respects the following EditorView properties:
scrollThreshold: A value (number or Rect) defining the boundary within which scrolling is triggered.scrollMargin: A number defining the padding applied to the scrolled position.
If the container is the document.body, it uses window.scrollBy. Otherwise, it scrolls the specific HTMLElement.