From c598c20b66e636a07d67ab29911a4e257d007e0d Mon Sep 17 00:00:00 2001 From: glo82145 Date: Wed, 27 Apr 2022 15:53:13 +0530 Subject: [PATCH 01/11] AC-2480::Flyout panels do not trap focus while open --- .../Navigation/__tests__/navigation.spec.js | 6 ++ .../lib/components/Navigation/navigation.js | 59 ++++++++++--------- 2 files changed, 37 insertions(+), 28 deletions(-) diff --git a/packages/venia-ui/lib/components/Navigation/__tests__/navigation.spec.js b/packages/venia-ui/lib/components/Navigation/__tests__/navigation.spec.js index 8ce0abe0d5..7a9cdb85cf 100755 --- a/packages/venia-ui/lib/components/Navigation/__tests__/navigation.spec.js +++ b/packages/venia-ui/lib/components/Navigation/__tests__/navigation.spec.js @@ -21,6 +21,12 @@ jest.mock('../../Header/currencySwitcher', () => () => 'CurrencySwitcher'); jest.mock('@magento/peregrine/lib/talons/Navigation/useNavigation'); +jest.mock('react-aria', () => ({ + FocusScope: jest.fn(({ children }) => { + return children; + }) +})); + /* * Tests. */ diff --git a/packages/venia-ui/lib/components/Navigation/navigation.js b/packages/venia-ui/lib/components/Navigation/navigation.js index f614cbe40b..b04ab17c9d 100755 --- a/packages/venia-ui/lib/components/Navigation/navigation.js +++ b/packages/venia-ui/lib/components/Navigation/navigation.js @@ -10,6 +10,7 @@ import StoreSwitcher from '../Header/storeSwitcher'; import LoadingIndicator from '../LoadingIndicator'; import NavHeader from './navHeader'; import defaultClasses from './navigation.module.css'; +import { FocusScope } from 'react-aria'; const AuthModal = React.lazy(() => import('../AuthModal')); @@ -52,35 +53,37 @@ const Navigation = props => { ) : null; return ( - +
+
+ + +
+ +
+
{authModal}
+ + ); }; From 54bafc8274cd65b1bfdec7556992c6b17ec83259 Mon Sep 17 00:00:00 2001 From: glo82145 Date: Mon, 2 May 2022 16:56:00 +0530 Subject: [PATCH 02/11] AC-2480::removed autoscope propety from FocusScope as not approved by yarn run lint --- packages/venia-ui/lib/components/Navigation/navigation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/venia-ui/lib/components/Navigation/navigation.js b/packages/venia-ui/lib/components/Navigation/navigation.js index b04ab17c9d..78aa8fa86c 100755 --- a/packages/venia-ui/lib/components/Navigation/navigation.js +++ b/packages/venia-ui/lib/components/Navigation/navigation.js @@ -53,7 +53,7 @@ const Navigation = props => { ) : null; return ( - +