From 7b72eb30794e8f1ac9a07ca50b7379e4b0015703 Mon Sep 17 00:00:00 2001 From: Kalmar Lorand <117274944+KalmarLorand@users.noreply.github.com> Date: Fri, 23 Aug 2024 09:19:58 +0300 Subject: [PATCH] [material-ui][Unstable_TrapFocus] Fix `getTabbable` function return type (#42237) Co-authored-by: ZeeshanTamboli --- packages/mui-material/src/Unstable_TrapFocus/FocusTrap.tsx | 2 +- packages/mui-material/src/Unstable_TrapFocus/FocusTrap.types.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/mui-material/src/Unstable_TrapFocus/FocusTrap.tsx b/packages/mui-material/src/Unstable_TrapFocus/FocusTrap.tsx index 264403eb00eac9..7a404740af6b68 100644 --- a/packages/mui-material/src/Unstable_TrapFocus/FocusTrap.tsx +++ b/packages/mui-material/src/Unstable_TrapFocus/FocusTrap.tsx @@ -270,7 +270,7 @@ function FocusTrap(props: FocusTrapProps): React.JSX.Element { return; } - let tabbable: ReadonlyArray | HTMLElement[] = []; + let tabbable: ReadonlyArray = []; if ( doc.activeElement === sentinelStart.current || doc.activeElement === sentinelEnd.current diff --git a/packages/mui-material/src/Unstable_TrapFocus/FocusTrap.types.ts b/packages/mui-material/src/Unstable_TrapFocus/FocusTrap.types.ts index be9cf5ee1e93c3..462100ec696479 100644 --- a/packages/mui-material/src/Unstable_TrapFocus/FocusTrap.types.ts +++ b/packages/mui-material/src/Unstable_TrapFocus/FocusTrap.types.ts @@ -10,7 +10,7 @@ export interface FocusTrapProps { * For instance, you can provide the "tabbable" npm dependency. * @param {HTMLElement} root */ - getTabbable?: (root: HTMLElement) => ReadonlyArray; + getTabbable?: (root: HTMLElement) => ReadonlyArray; /** * 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.