Respect focus with preventScroll

You’ll notice that this happens on Chrome but not Firefox, because Chrome (and possibly also Safari, I can’t remember) will reset the selection when you focus an editable element, moving it to the start of the element. ProseMirror includes a workaround that restores the previous selection in this case and, as you notice, scrolls it back into view. Unfortunately, at the point where that hack runs, it doesn’t have enough information to know whether the scroll position it sees is the result of the browser scrolling the start of the document into view or not.

The workaround for you would be to call view.focus() instead of the DOM focus method. That won’t scroll (or rather, that will properly counteract the browser’s inappropriate scrolling), and will make sure the selection is where it should be.