Skip to content

Commit 004f1c1

Browse files
Fix type of getTabbable prop in Unstable Focus Trap in Material UI
1 parent fe4125e commit 004f1c1

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

packages/mui-base/src/FocusTrap/FocusTrap.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export interface FocusTrapProps {
1010
* For instance, you can provide the "tabbable" npm dependency.
1111
* @param {HTMLElement} root
1212
*/
13-
getTabbable?: (root: HTMLElement) => ReadonlyArray<HTMLElement>;
13+
getTabbable?: (root: HTMLElement) => ReadonlyArray<string>;
1414
/**
1515
* This prop extends the `open` prop.
1616
* It allows to toggle the open state without having to wait for a rerender when changing the `open` prop.

packages/mui-material/src/Unstable_TrapFocus/FocusTrap.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ function FocusTrap(props: FocusTrapProps): React.JSX.Element {
270270
return;
271271
}
272272

273-
let tabbable: ReadonlyArray<string> | HTMLElement[] = [];
273+
let tabbable: ReadonlyArray<HTMLElement> = [];
274274
if (
275275
doc.activeElement === sentinelStart.current ||
276276
doc.activeElement === sentinelEnd.current

packages/mui-material/src/Unstable_TrapFocus/FocusTrap.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export interface FocusTrapProps {
1010
* For instance, you can provide the "tabbable" npm dependency.
1111
* @param {HTMLElement} root
1212
*/
13-
getTabbable?: (root: HTMLElement) => ReadonlyArray<string>;
13+
getTabbable?: (root: HTMLElement) => ReadonlyArray<HTMLElement>;
1414
/**
1515
* This prop extends the `open` prop.
1616
* It allows to toggle the open state without having to wait for a rerender when changing the `open` prop.

0 commit comments

Comments
 (0)