src/index.js
/**
   * Returns the key that matches the text content or label
   * 
   * @param {String} keypress - Alphanumeric keyboard key
   * @returns {String} - A valid key to focus
   */
Returns the key that matches the text content or label

@param {String} keypress - Alphanumeric keyboard key
@returns {String} - A valid key to focus
Returns the key that matches the text content or label @param { String } keypress - Alphanumeric keyboard key @returns { String } - A valid key to focus
function onInput(keypress) {
    const rgx = new RegExp(`^${keypress}{1}`, 'i')
    for (const [key, ref] of refs.entries()) {
      if (
        rgx.test(ref?.current?.textContent) ||
        rgx.test(ref?.current?.getAttribute('aria-label'))
        )
      return key;
    }
    return state.key;
  }
function onInput ( keypress ) { const rgx = new RegExp ( ` ${ keypress } ` , 'i' ) for ( const [ key , ref ] of refs . entries ( ) ) { if ( rgx . test ( ref ?. current ?. textContent ) || rgx . test ( ref ?. current ?. getAttribute ( 'aria-label' ) ) ) return key ; } return state . key ; }
Returns the key that matches the text content or label
Returns the key that matches the text content or label