Skip to content

Commit

Permalink
Fix type of getTabbable prop in Unstable Focus Trap in Material UI
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeeshanTamboli committed Aug 23, 2024
1 parent fe4125e commit 004f1c1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/mui-base/src/FocusTrap/FocusTrap.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface FocusTrapProps {
* For instance, you can provide the "tabbable" npm dependency.
* @param {HTMLElement} root
*/
getTabbable?: (root: HTMLElement) => ReadonlyArray<HTMLElement>;
getTabbable?: (root: HTMLElement) => ReadonlyArray<string>;
/**
* This prop extends the `open` prop.
* It allows to toggle the open state without having to wait for a rerender when changing the `open` prop.
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-material/src/Unstable_TrapFocus/FocusTrap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ function FocusTrap(props: FocusTrapProps): React.JSX.Element {
return;
}

let tabbable: ReadonlyArray<string> | HTMLElement[] = [];
let tabbable: ReadonlyArray<HTMLElement> = [];
if (
doc.activeElement === sentinelStart.current ||
doc.activeElement === sentinelEnd.current
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface FocusTrapProps {
* For instance, you can provide the "tabbable" npm dependency.
* @param {HTMLElement} root
*/
getTabbable?: (root: HTMLElement) => ReadonlyArray<string>;
getTabbable?: (root: HTMLElement) => ReadonlyArray<HTMLElement>;
/**
* This prop extends the `open` prop.
* It allows to toggle the open state without having to wait for a rerender when changing the `open` prop.
Expand Down

0 comments on commit 004f1c1

Please sign in to comment.