packages/basic-component-mixins/src/KeyboardPrefixSelectionMixin.js
function getIndexOfItemWithTextPrefix(element, prefix) {
  const itemTextContents = getItemTextContents(element);
  const prefixLength = prefix.length;
  for (let i = 0; i < itemTextContents.length; i++) {
    const itemTextContent = itemTextContents[i];
    if (itemTextContent.substr(0, prefixLength) === prefix) {
      return i;
    }
  }
  return -1;
}
function getIndexOfItemWithTextPrefix(element, prefix) {
  const itemTextContents = getItemTextContents(element);
  const prefixLength = prefix.length;
  for (let i = 0; i < itemTextContents.length; i++) {
    const itemTextContent = itemTextContents[i];
    if (itemTextContent.substr(0, prefixLength) === prefix) {
      return i;
    }
  }
  return -1;
}
function getIndexOfItemWithTextPrefix ( element , prefix ) { const itemTextContents = getItemTextContents ( element ) ; const prefixLength = prefix . length ; for ( let i = 0 ; i < itemTextContents . length ; i ++ ) { const itemTextContent = itemTextContents [ i ] ; if ( itemTextContent . substr ( 0 , prefixLength ) === prefix ) { return i ; } } return - 1 ; }
Return the index of the first item with the given prefix, else -1.
Return the index of the first item with the given prefix else - 1 .