More precisely, from the animated .gif you can see that the scrolling occured even before the node is dropped.
I believe what you are seeing @wleung is a function of the browser focusing a non-Diagram element, so adding that code won’t change anything. The browser always tries to focus as much of an HTML element as possible if it is partly off-screen, and the elements on the right seem to be moving it.