Previously, when _getNextindex was called, if there were no more
matches, it would return the current index. This change updates the
function to return the first or last stop instead, depending on whether
the delta is positive or negative.
This change also fixes a bug in _scrollToTarget in which 'top' wasn't
calculated after _targetIsVisible was pulled out into a separate
function.
Feature: Issue 5280
Change-Id: Idc0d73aaca607f24f4f8d8cd28bd92f899288d85