From 24507ff4d604589dbc45f51a8b0c6695fdbbc9f6 Mon Sep 17 00:00:00 2001 From: Lingfan Gao Date: Tue, 21 Feb 2023 17:58:44 +0100 Subject: [PATCH 1/3] fix: Popover without focus trap should not be aria-hidden After #26584 where tabster was major bumped, a bugfix was made so that modalizers without `isAlwaysAccessible` would always be aria-hidden. This was never set in the popover because it was never needed. Now that the bug has been fixed upstream in tabster, it is required. --- .../src/components/PopoverSurface/usePopoverSurface.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 abf06c0b0dd0d..370465d6c4d15 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, From ac62be6f1709418532f7c71935d7a48b71dd700d Mon Sep 17 00:00:00 2001 From: Lingfan Gao Date: Tue, 21 Feb 2023 18:01:29 +0100 Subject: [PATCH 2/3] changefile --- ...react-popover-e33a0b34-bcda-454b-be5e-8ca39b89cf3c.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 change/@fluentui-react-popover-e33a0b34-bcda-454b-be5e-8ca39b89cf3c.json 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 0000000000000..759960c5ca9b7 --- /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" +} From 4c3cab378e5253c64c1187d486db12c714f442ad Mon Sep 17 00:00:00 2001 From: Lingfan Gao Date: Wed, 22 Feb 2023 11:04:41 +0100 Subject: [PATCH 3/3] fix snapshot --- .../PopoverSurface/__snapshots__/PopoverSurface.test.tsx.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 5bf2a8aeea392..d5445f25375b2 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`] = `