code: function setFocus(index, increment) {
        var focusableElements = getFocusableElements(innerParams.focusCancel); // search for visible elements and select the next possible match
  
        for (var _i = 0; _i < focusableElements.length; _i++) {
          index = index + increment; // rollover to first item
  
          if (index === focusableElements.length) {
            index = 0; // go to last item
          } else if (index === -1) {
            index = focusableElements.length - 1;
          }
  
          return focusableElements[index].focus();
        } // no visible focusable elements, focus the popup
  
  
        domCache.popup.focus();
      }
docs: Focus handling