mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-17 23:10:44 +00:00
foreach
This commit is contained in:
@@ -38,7 +38,7 @@ function registerShortcuts(
|
|||||||
): () => void {
|
): () => void {
|
||||||
const wrappedShortcuts: Record<string, ShortcutHandler> = {};
|
const wrappedShortcuts: Record<string, ShortcutHandler> = {};
|
||||||
|
|
||||||
for (const [key, handler] of Object.entries(shortcuts)) {
|
Object.entries(shortcuts).forEach(([key, handler]) => {
|
||||||
wrappedShortcuts[key] = (event: KeyboardEvent) => {
|
wrappedShortcuts[key] = (event: KeyboardEvent) => {
|
||||||
if (!canOverrideAlphanumericInput(event.composedPath())) {
|
if (!canOverrideAlphanumericInput(event.composedPath())) {
|
||||||
return;
|
return;
|
||||||
@@ -48,7 +48,7 @@ function registerShortcuts(
|
|||||||
}
|
}
|
||||||
handler(event);
|
handler(event);
|
||||||
};
|
};
|
||||||
}
|
});
|
||||||
|
|
||||||
// Underlying implementation (tinykeys for now)
|
// Underlying implementation (tinykeys for now)
|
||||||
return tinykeys(window, wrappedShortcuts);
|
return tinykeys(window, wrappedShortcuts);
|
||||||
|
|||||||
Reference in New Issue
Block a user