function runActionOnBufferedTypedCharacters(event, action) {
    const letter = event.key;

    if (letter && letter.length > 1) {
        // Not an individual character/letter, but rather a special code (like Shift, Backspace, etc.)
        return;
    }

    // If we were going to clear what keys were typed, don't yet.
    if (buffer._clearBufferId) {
        clearTimeout(buffer._clearBufferId);
    }

    buffer._keyBuffer = buffer._keyBuffer || [];
    buffer._keyBuffer.push(letter);

    const matchText = buffer._keyBuffer.join('').toLowerCase();

    action(matchText);

    // eslint-disable-next-line @lwc/lwc/no-async-operation
    buffer._clearBufferId = setTimeout(() => {
        buffer._keyBuffer = [];
    }, 700);
}
/**
 * Runs an action and passes the string of buffered keys typed within a short time period.
 * Use for type-ahead like functionality in menus, lists, comboboxes, and similar components.
 *
 * @param {CustomEvent} event A keyboard event
 * @param {Function} action function to run, it's passed the buffered text
 */
Runs an action and passes the string of buffered keys typed within a short time period.
Use for type-ahead like functionality in menus, lists, comboboxes, and similar components.

@param {CustomEvent} event A keyboard event
@param {Function} action function to run, it's passed the buffered text
Runs an action and passes the string of buffered keys typed within a short time period . Use for type - ahead like functionality in menus lists comboboxes and similar components . @param { CustomEvent } event A keyboard event @param { Function } action function to run it ' s passed the buffered text
function runActionOnBufferedTypedCharacters(event, action) {
    const letter = event.key;
    if (letter && letter.length > 1) {
        return;
    }
    if (buffer._clearBufferId) {
        clearTimeout(buffer._clearBufferId);
    }
    buffer._keyBuffer = buffer._keyBuffer || [];
    buffer._keyBuffer.push(letter);
    const matchText = buffer._keyBuffer.join('').toLowerCase();
    action(matchText);
    buffer._clearBufferId = setTimeout(() => {
        buffer._keyBuffer = [];
    }, 700);
}
function runActionOnBufferedTypedCharacters ( event , action ) { const letter = event . key ; if ( letter && letter . length > 1 ) { return ; } if ( buffer . _clearBufferId ) { clearTimeout ( buffer . _clearBufferId ) ; } buffer . _keyBuffer = buffer . _keyBuffer || [ ] ; buffer . _keyBuffer . push ( letter ) ; const matchText = buffer . _keyBuffer . join ( '' ) . toLowerCase ( ) ; action ( matchText ) ; buffer . _clearBufferId = setTimeout ( ( ) => { buffer . _keyBuffer = [ ] ; } , 700 ) ; }
Runs an action and passes the string of buffered keys typed within a short time period.
Runs an action and passes the string of buffered keys typed within a short time period .
// Not an individual character/letter, but rather a special code (like Shift, Backspace, etc.) // If we were going to clear what keys were typed, don't yet. // eslint-disable-next-line @lwc/lwc/no-async-operation