From 2fc6a71a12295aa8d6997401fc164a98d9016bec Mon Sep 17 00:00:00 2001 From: Eric Olkowski Date: Tue, 19 Apr 2022 15:19:35 -0400 Subject: [PATCH 1/2] fix(PageSection): make content scrollable via keyboard with hasOverflowScroll --- packages/react-core/src/components/Page/PageSection.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/react-core/src/components/Page/PageSection.tsx b/packages/react-core/src/components/Page/PageSection.tsx index 5a70100ccc3..1b6937e1c42 100644 --- a/packages/react-core/src/components/Page/PageSection.tsx +++ b/packages/react-core/src/components/Page/PageSection.tsx @@ -101,6 +101,7 @@ export const PageSection: React.FunctionComponent = ({ hasOverflowScroll && styles.modifiers.overflowScroll, className )} + {...(hasOverflowScroll && { tabIndex: 0 })} > {isWidthLimited &&
{children}
} {!isWidthLimited && children} From 1af43a2f9935863326f140530ca6284ec653ffde Mon Sep 17 00:00:00 2001 From: Eric Olkowski Date: Wed, 20 Apr 2022 09:05:21 -0400 Subject: [PATCH 2/2] Add tabindex to remaining Page components with hasOverflowScroll --- packages/react-core/src/components/Page/PageBreadcrumb.tsx | 1 + packages/react-core/src/components/Page/PageGroup.tsx | 1 + packages/react-core/src/components/Page/PageNavigation.tsx | 1 + .../Page/__tests__/__snapshots__/PageBreadcrumb.test.tsx.snap | 1 + .../Page/__tests__/__snapshots__/PageGroup.test.tsx.snap | 1 + .../Page/__tests__/__snapshots__/PageNavigation.test.tsx.snap | 1 + .../Page/__tests__/__snapshots__/PageSection.test.tsx.snap | 1 + 7 files changed, 7 insertions(+) diff --git a/packages/react-core/src/components/Page/PageBreadcrumb.tsx b/packages/react-core/src/components/Page/PageBreadcrumb.tsx index 6fc966249c9..894c5b2fbfe 100644 --- a/packages/react-core/src/components/Page/PageBreadcrumb.tsx +++ b/packages/react-core/src/components/Page/PageBreadcrumb.tsx @@ -40,6 +40,7 @@ export const PageBreadcrumb = ({ hasOverflowScroll && styles.modifiers.overflowScroll, className )} + {...(hasOverflowScroll && { tabIndex: 0 })} {...props} > {isWidthLimited &&
{children}
} diff --git a/packages/react-core/src/components/Page/PageGroup.tsx b/packages/react-core/src/components/Page/PageGroup.tsx index 134a4cd2257..47839f60c90 100644 --- a/packages/react-core/src/components/Page/PageGroup.tsx +++ b/packages/react-core/src/components/Page/PageGroup.tsx @@ -37,6 +37,7 @@ export const PageGroup = ({ hasOverflowScroll && styles.modifiers.overflowScroll, className )} + {...(hasOverflowScroll && { tabIndex: 0 })} > {children} diff --git a/packages/react-core/src/components/Page/PageNavigation.tsx b/packages/react-core/src/components/Page/PageNavigation.tsx index 0d3d1a63877..8b63c37e0d9 100644 --- a/packages/react-core/src/components/Page/PageNavigation.tsx +++ b/packages/react-core/src/components/Page/PageNavigation.tsx @@ -40,6 +40,7 @@ export const PageNavigation = ({ hasOverflowScroll && styles.modifiers.overflowScroll, className )} + {...(hasOverflowScroll && { tabIndex: 0 })} {...props} > {isWidthLimited &&
{children}
} diff --git a/packages/react-core/src/components/Page/__tests__/__snapshots__/PageBreadcrumb.test.tsx.snap b/packages/react-core/src/components/Page/__tests__/__snapshots__/PageBreadcrumb.test.tsx.snap index 4e6d54bfe79..bf053a165f9 100644 --- a/packages/react-core/src/components/Page/__tests__/__snapshots__/PageBreadcrumb.test.tsx.snap +++ b/packages/react-core/src/components/Page/__tests__/__snapshots__/PageBreadcrumb.test.tsx.snap @@ -48,6 +48,7 @@ exports[`page breadcrumb Verify overflow scroll 1`] = `
test
diff --git a/packages/react-core/src/components/Page/__tests__/__snapshots__/PageGroup.test.tsx.snap b/packages/react-core/src/components/Page/__tests__/__snapshots__/PageGroup.test.tsx.snap index eb94d26ef19..47ed06f3641 100644 --- a/packages/react-core/src/components/Page/__tests__/__snapshots__/PageGroup.test.tsx.snap +++ b/packages/react-core/src/components/Page/__tests__/__snapshots__/PageGroup.test.tsx.snap @@ -34,6 +34,7 @@ exports[`page group Verify overflow scroll 1`] = `
test
diff --git a/packages/react-core/src/components/Page/__tests__/__snapshots__/PageNavigation.test.tsx.snap b/packages/react-core/src/components/Page/__tests__/__snapshots__/PageNavigation.test.tsx.snap index 6d9c25c300e..810165825ea 100644 --- a/packages/react-core/src/components/Page/__tests__/__snapshots__/PageNavigation.test.tsx.snap +++ b/packages/react-core/src/components/Page/__tests__/__snapshots__/PageNavigation.test.tsx.snap @@ -48,6 +48,7 @@ exports[`page navigation Verify overflow scroll 1`] = `
test
diff --git a/packages/react-core/src/components/Page/__tests__/__snapshots__/PageSection.test.tsx.snap b/packages/react-core/src/components/Page/__tests__/__snapshots__/PageSection.test.tsx.snap index ce1c1642c89..7718355098d 100644 --- a/packages/react-core/src/components/Page/__tests__/__snapshots__/PageSection.test.tsx.snap +++ b/packages/react-core/src/components/Page/__tests__/__snapshots__/PageSection.test.tsx.snap @@ -112,6 +112,7 @@ exports[`Verify page section overflow scroll 1`] = `
test