From 8ca78c9cd2915b4ace65c271b98111461c23be02 Mon Sep 17 00:00:00 2001 From: ZeeshanTamboli Date: Tue, 6 Jan 2026 12:56:41 +0530 Subject: [PATCH 1/3] Compute activeElement inside loopFocus --- packages/mui-material/src/Unstable_TrapFocus/FocusTrap.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/mui-material/src/Unstable_TrapFocus/FocusTrap.tsx b/packages/mui-material/src/Unstable_TrapFocus/FocusTrap.tsx index 70790d64e317af..1678182dcd84f1 100644 --- a/packages/mui-material/src/Unstable_TrapFocus/FocusTrap.tsx +++ b/packages/mui-material/src/Unstable_TrapFocus/FocusTrap.tsx @@ -211,7 +211,6 @@ function FocusTrap(props: FocusTrapProps): React.JSX.Element { } const doc = ownerDocument(rootRef.current); - const activeElement = getActiveElement(doc); const loopFocus = (nativeEvent: KeyboardEvent) => { lastKeydown.current = nativeEvent; @@ -220,6 +219,8 @@ function FocusTrap(props: FocusTrapProps): React.JSX.Element { return; } + const activeElement = getActiveElement(doc); + // Make sure the next tab starts from the right place. // activeElement refers to the origin. if (activeElement === rootRef.current && nativeEvent.shiftKey) { From a556f3db1a1e79fc2e761c12179214d85a90d5ec Mon Sep 17 00:00:00 2001 From: ZeeshanTamboli Date: Tue, 6 Jan 2026 13:05:46 +0530 Subject: [PATCH 2/3] rerun CI From d1659ba709b0e7a83ce462bfb29f9306c84d567d Mon Sep 17 00:00:00 2001 From: ZeeshanTamboli Date: Tue, 6 Jan 2026 13:52:56 +0530 Subject: [PATCH 3/3] rerun CI