mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-08-07 09:13:04 +02:00
Accessibility overhaul
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import type { KeyboardEvent } from 'react';
|
||||
|
||||
/** Activate a clickable non-button element on Enter or Space, mirroring native button behavior. */
|
||||
export function handleKeyboardActivate(e: KeyboardEvent) {
|
||||
if (e.key === 'Enter' || e.key === ' ') {
|
||||
e.preventDefault();
|
||||
(e.currentTarget as HTMLElement).click();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user