MCPcopy Index your code
hub / github.com/Tailframes/react-components / handleKeyboardEvent

Function handleKeyboardEvent

utils.ts:16–26  ·  view source on GitHub ↗
(
    key: KeyboardEvent['key'] | Array<KeyboardEvent['key']>,
    callback: (event: SyntheticEvent<Type>) => void
  )

Source from the content-addressed store, hash-verified

14
15export const handleKeyboardEvent =
16 <Type = Element>(
17 key: KeyboardEvent['key'] | Array<KeyboardEvent['key']>,
18 callback: (event: SyntheticEvent<Type>) => void
19 ) =>
20 (event: KeyboardEvent<Type>) => {
21 const keys = Array.isArray(key) ? key : [key];
22
23 if (keys.includes(event.key)) {
24 callback(event);
25 }
26 };

Callers 2

SelectFunction · 0.90
SelectOptionFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected