Skip to content

Commit

Permalink
Prefer direct children type declaration in HotkeysProps
Browse files Browse the repository at this point in the history
  • Loading branch information
ggdouglas committed Jan 10, 2025
1 parent 68ff3ab commit 878e63c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/core/src/components/hotkeys/hotkeys.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { H4 } from "../html/html";

import { Hotkey, type HotkeyProps } from "./hotkey";

export interface HotkeysProps extends Props, React.PropsWithChildren<object> {
export interface HotkeysProps extends Props {
/**
* In order to make local hotkeys work on elements that are not normally
* focusable, such as `<div>`s or `<span>`s, we add a `tabIndex` attribute
Expand All @@ -34,6 +34,11 @@ export interface HotkeysProps extends Props, React.PropsWithChildren<object> {
* the `tabIndex` from the component decorated by `HotkeysTarget`.
*/
tabIndex?: number;

/**
* An array of `Hotkey` components that define the hotkeys to be used.
*/
children?: Array<React.ReactElement<HotkeyProps>>;
}

/**
Expand Down

0 comments on commit 878e63c

Please sign in to comment.