(
event: KeyboardEvent,
action: () => void,
options: KeyboardActivationOptions = {}
)
| 9 | } |
| 10 | |
| 11 | export function handleKeyboardActivation( |
| 12 | event: KeyboardEvent, |
| 13 | action: () => void, |
| 14 | options: KeyboardActivationOptions = {} |
| 15 | ) { |
| 16 | if (!isKeyboardActivation(event)) return |
| 17 | |
| 18 | event.preventDefault() |
| 19 | |
| 20 | if (options.stopPropagation) { |
| 21 | event.stopPropagation() |
| 22 | } |
| 23 | |
| 24 | action() |
| 25 | } |
no test coverage detected