diff --git a/change/@fluentui-react-popover-e33a0b34-bcda-454b-be5e-8ca39b89cf3c.json b/change/@fluentui-react-popover-e33a0b34-bcda-454b-be5e-8ca39b89cf3c.json new file mode 100644 index 00000000000000..759960c5ca9b79 --- /dev/null +++ b/change/@fluentui-react-popover-e33a0b34-bcda-454b-be5e-8ca39b89cf3c.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "fix: Popover without focus trap should not be aria-hidden", + "packageName": "@fluentui/react-popover", + "email": "lingfangao@hotmail.com", + "dependentChangeType": "patch" +} diff --git a/packages/react-components/react-popover/src/components/PopoverSurface/__snapshots__/PopoverSurface.test.tsx.snap b/packages/react-components/react-popover/src/components/PopoverSurface/__snapshots__/PopoverSurface.test.tsx.snap index 5bf2a8aeea3920..d5445f25375b23 100644 --- a/packages/react-components/react-popover/src/components/PopoverSurface/__snapshots__/PopoverSurface.test.tsx.snap +++ b/packages/react-components/react-popover/src/components/PopoverSurface/__snapshots__/PopoverSurface.test.tsx.snap @@ -4,7 +4,7 @@ exports[`PopoverSurface renders a default state 1`] = `
diff --git a/packages/react-components/react-popover/src/components/PopoverSurface/usePopoverSurface.ts b/packages/react-components/react-popover/src/components/PopoverSurface/usePopoverSurface.ts index abf06c0b0dd0d1..370465d6c4d157 100644 --- a/packages/react-components/react-popover/src/components/PopoverSurface/usePopoverSurface.ts +++ b/packages/react-components/react-popover/src/components/PopoverSurface/usePopoverSurface.ts @@ -28,7 +28,7 @@ export const usePopoverSurface_unstable = ( const trapFocus = usePopoverContext_unstable(context => context.trapFocus); const legacyTrapFocus = usePopoverContext_unstable(context => context.legacyTrapFocus); const inline = usePopoverContext_unstable(context => context.inline); - const { modalAttributes } = useModalAttributes({ trapFocus, legacyTrapFocus }); + const { modalAttributes } = useModalAttributes({ trapFocus, legacyTrapFocus, alwaysFocusable: !trapFocus }); const state: PopoverSurfaceState = { inline,