navigate(amt = 0, doFocus = false) {
    const items = this.items;
    let currentItem = this.focused || items[0];

    if (typeof amt !== 'number') {
      return currentItem;
    }

    // Calculate steps/meta
    const negative = amt < 0;
    let steps = Math.abs(amt);
    let currentIndex = items.indexOf(currentItem);

    // Step through items to the target
    while (steps > 0) {
      currentItem = items[currentIndex + (negative ? -1 : 1)];
      currentIndex = items.indexOf(currentItem);

      // "-1" means we've crossed the boundary and need to loop back around
      if (currentIndex < 0) {
        currentIndex = (negative ? items.length - 1 : 0);
        currentItem = items[currentIndex];
      }

      // Don't count disabled items as "taking a step"
      if (!currentItem.disabled) {
        steps -= 1;
      }
    }

    if (!currentItem.disabled && doFocus) {
      this.makeTabbable(currentItem);
      currentItem.focus();
    }

    return currentItem;
  }
/**
   * Uses a currently-highlighted toolbar item to "navigate" a specified number
   * of steps to another toolbar item, highlighting it.
   * @param {number} [amt] the amount of items to navigate
   * @param {boolean} [doFocus] if true, causes the new item to become focused.
   * @returns {any} the item that will be focused
   */
Uses a currently-highlighted toolbar item to "navigate" a specified number
of steps to another toolbar item, highlighting it.
@param {number} [amt] the amount of items to navigate
@param {boolean} [doFocus] if true, causes the new item to become focused.
@returns {any} the item that will be focused
Uses a currently - highlighted toolbar item to " navigate " a specified number of steps to another toolbar item highlighting it . @param { number } [ amt ] the amount of items to navigate @param { boolean } [ doFocus ] if true causes the new item to become focused . @returns { any } the item that will be focused
navigate(amt = 0, doFocus = false) {
    const items = this.items;
    let currentItem = this.focused || items[0];
    if (typeof amt !== 'number') {
      return currentItem;
    }
    const negative = amt < 0;
    let steps = Math.abs(amt);
    let currentIndex = items.indexOf(currentItem);
    while (steps > 0) {
      currentItem = items[currentIndex + (negative ? -1 : 1)];
      currentIndex = items.indexOf(currentItem);
      if (currentIndex < 0) {
        currentIndex = (negative ? items.length - 1 : 0);
        currentItem = items[currentIndex];
      }
      if (!currentItem.disabled) {
        steps -= 1;
      }
    }
    if (!currentItem.disabled && doFocus) {
      this.makeTabbable(currentItem);
      currentItem.focus();
    }
    return currentItem;
  }
navigate ( amt = 0 , doFocus = false ) { const items = this . items ; let currentItem = this . focused || items [ 0 ] ; if ( typeof amt !== 'number' ) { return currentItem ; } const negative = amt < 0 ; let steps = Math . abs ( amt ) ; let currentIndex = items . indexOf ( currentItem ) ; while ( steps > 0 ) { currentItem = items [ currentIndex + ( negative ? - 1 : 1 ) ] ; currentIndex = items . indexOf ( currentItem ) ; if ( currentIndex < 0 ) { currentIndex = ( negative ? items . length - 1 : 0 ) ; currentItem = items [ currentIndex ] ; } if ( ! currentItem . disabled ) { steps -= 1 ; } } if ( ! currentItem . disabled && doFocus ) { this . makeTabbable ( currentItem ) ; currentItem . focus ( ) ; } return currentItem ; }
Uses a currently-highlighted toolbar item to "navigate" a specified number
 of steps to another toolbar item, highlighting it.
Uses a currently - highlighted toolbar item to " navigate " a specified number of steps to another toolbar item highlighting it .
// Calculate steps/meta // Step through items to the target // "-1" means we've crossed the boundary and need to loop back around // Don't count disabled items as "taking a step"