From 8d85b90af0d72352efb9a76d818f9eec11515d4c Mon Sep 17 00:00:00 2001 From: Oleksandr Fediashov Date: Tue, 16 Jun 2026 11:29:06 +0200 Subject: [PATCH] fix(react-menu): remove the tabster restorer source from MenuPopover Follow-up to #32840, which moved Menu off the tabster Restorer (removed the restore target from MenuTrigger, restores focus manually) but kept the restorer source on MenuPopover for triggerless menus. This removes that remaining source, completing the move away from the restorer (the source of the "unintended focus switching" #32840 set out to avoid). Triggered menus are unaffected (manual restore); triggerless menus allow focus to fall to on close, per #32840. Co-Authored-By: Claude Opus 4.8 (1M context) --- ...ui-react-menu-b854a376-deed-4e31-ad96-3a351d4890c6.json | 7 +++++++ .../library/src/components/MenuPopover/useMenuPopover.ts | 3 --- 2 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 change/@fluentui-react-menu-b854a376-deed-4e31-ad96-3a351d4890c6.json diff --git a/change/@fluentui-react-menu-b854a376-deed-4e31-ad96-3a351d4890c6.json b/change/@fluentui-react-menu-b854a376-deed-4e31-ad96-3a351d4890c6.json new file mode 100644 index 00000000000000..a27e8212cde80c --- /dev/null +++ b/change/@fluentui-react-menu-b854a376-deed-4e31-ad96-3a351d4890c6.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "fix: remove the tabster restorer source from MenuPopover", + "packageName": "@fluentui/react-menu", + "email": "olfedias@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/packages/react-components/react-menu/library/src/components/MenuPopover/useMenuPopover.ts b/packages/react-components/react-menu/library/src/components/MenuPopover/useMenuPopover.ts index 5fed05c1f79f7c..bb28805f8baa7b 100644 --- a/packages/react-components/react-menu/library/src/components/MenuPopover/useMenuPopover.ts +++ b/packages/react-components/react-menu/library/src/components/MenuPopover/useMenuPopover.ts @@ -3,7 +3,6 @@ import { ArrowLeft, Tab, ArrowRight, Escape } from '@fluentui/keyboard-keys'; import { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts'; import { useMotionForwardedRef } from '@fluentui/react-motion'; -import { useRestoreFocusSource } from '@fluentui/react-tabster'; import { getIntrinsicElementProps, useEventCallback, useMergedRefs, slot, useTimeout } from '@fluentui/react-utilities'; import * as React from 'react'; @@ -128,14 +127,12 @@ export const useMenuPopoverBase_unstable = (props: MenuPopoverProps, ref: React. * @param ref - reference to root HTMLElement of MenuPopover */ export const useMenuPopover_unstable = (props: MenuPopoverProps, ref: React.Ref): MenuPopoverState => { - const restoreFocusSourceAttributes = useRestoreFocusSource(); const motionRef = useMotionForwardedRef(); const baseState = useMenuPopoverBase_unstable(props, ref); return { ...baseState, root: { - ...restoreFocusSourceAttributes, ...baseState.root, ref: useMergedRefs(baseState.root.ref, motionRef) as React.Ref, },