Last modified: 2014-10-03 17:51:49 UTC
Scrolling elements into view does not work in most cases; in fact it seems to depend on some Blink-specific behaviors and thus only works reliably on Blink. In particular, the code below doesn't scroll the page at all when it clearly should. (Adjust the numbers to be large enough for your screen.) var el = new OO.ui.Element( { text: 'Test' } ); el.$element.css( { position: 'absolute', left: 2000, top: 3000 } ); el.$element.appendTo( 'body' ); el.scrollElementIntoView(); Bug 71540 in VE is another case, the page is only scrolled horizontally in Blink (although vertical scrolling works). I haven't investigated closely, but getClosestScrollableContainer() hard-codes document's body for some cases, and apparently browsers prefer to scroll documentElement instead. (Prior to bug 54928 it fell back on window, and Krinkle's comments on that bug claim that jQuery can't animate scrolling on documentElement. I haven't verified that.)