You need to use the dojo/window library and specifically the function ScrollIntoView. See: https://dojotoolkit.org/api/?qs=1.7/dojo/window
An implementation of this can be found in the FocusOnErrorWidget. The part were it is used is:
// Scroll element into view
win.scrollIntoView(node);
// Find any input or select elements in the node and set the focus if found.
// (Note that an error could be displayed on a read only element.)
inputNodeList = domQuery('input, select', node);
if (inputNodeList.length > 0) {
inputNodeList[0].focus();
}
Here, 'win' is a reference to 'dojo/window'.
Good luck!
The code you can use inside the snippet:
require(["dojo/window"], function(win){ // here comes your JS code. References to the window library can be made like: win.scrollIntoView });