code: function selectNextWithWrap(element) {
    const items = element.items;
    if (items && items.length > 0) {
      if (element.selectedIndex == null || element.selectedIndex === items.length - 1) {
        element.selectFirst();
      } else {
        element.selectNext();
      }
    }
  }
docs: Select the next item, wrapping to first item if necessary.