Riff / Built on the open web / Interface
scrollIntoView
Brings the playing track into view when Up next opens.

How Riff uses it
When the Up next sheet opens, the current track's item in the list is scrolled into view with block: nearest. In the Listen app, after a view swap, the app scrolls to its top only if it had scrolled off above the viewport.
Why
A long queue would otherwise open at its top with the playing track somewhere below.
Where
- plugins/riff/assets/riff.js, line 1116
?.scrollIntoView( { block: 'nearest' } ); - plugins/riff/features/listen/app.js, line 122
app.scrollIntoView( { block: 'start' } );
Links open the source at the commit this page was published from.
Reference: scrollIntoView on MDN.