code: function refreshIndex () {
      ctrl.selectedIndex = getNearestSafeIndex(ctrl.selectedIndex);
      ctrl.focusIndex    = getNearestSafeIndex(ctrl.focusIndex);
    }
docs: Moves the indexes to their nearest valid values.