Skip to content

Commit

Permalink
[a11y] More role="region" cleanup (#7327)
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen authored Nov 1, 2023
1 parent 92efeb4 commit 1a8988c
Show file tree
Hide file tree
Showing 10 changed files with 923 additions and 1,022 deletions.
20 changes: 4 additions & 16 deletions src-docs/src/views/scroll/full_height.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,7 @@ export default () => {
responsive={false}
>
<EuiFlexItem>
<EuiPanel
className="eui-yScroll"
color="warning"
tabIndex={0}
role="region"
aria-label="Example 1 for full height region"
>
<EuiPanel className="eui-yScroll" color="warning" tabIndex={0}>
<EuiText size="s">
<p>
Orbiting this at a distance of roughly ninety-two million
Expand All @@ -57,13 +51,7 @@ export default () => {
</EuiPanel>
</EuiFlexItem>
<EuiFlexItem>
<EuiPanel
className="eui-yScroll"
color="warning"
tabIndex={0}
role="region"
aria-label="Example 2 for full height region"
>
<EuiPanel className="eui-yScroll" color="warning" tabIndex={0}>
<EuiText size="s">
<p>
Orbiting this at a distance of roughly ninety-two million
Expand All @@ -83,11 +71,11 @@ export default () => {
className="eui-fullHeight" responsive={false}>
<EuiFlexItem>
<BodyScroll
className="eui-yScroll" tabIndex={0} role="region" aria-label=""/>
className="eui-yScroll" tabIndex={0} />
</EuiFlexItem>
<EuiFlexItem>
<BodyScroll
className="eui-yScroll" tabIndex={0} role="region" aria-label=""/>
className="eui-yScroll" tabIndex={0} />
</EuiFlexItem>
</EuiFlexGroup>
</BodyContent>`}
Expand Down
18 changes: 2 additions & 16 deletions src-docs/src/views/scroll/scroll.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ export default () => {
example={
<div
tabIndex={0}
role="region"
aria-label="Example of eui-scrollBar region"
className="eui-scrollBar"
style={{
overflowY: 'auto',
Expand All @@ -53,12 +51,7 @@ export default () => {
<ScrollContent />
</div>
}
snippet={`<div
tabIndex={0}
role="region"
aria-label=""
className="eui-scrollBar"
>
snippet={`<div tabIndex={0} className="eui-scrollBar">
<EuiPanel />
<EuiPanel />
<EuiPanel />
Expand Down Expand Up @@ -88,8 +81,6 @@ export default () => {
example={
<div
tabIndex={0}
role="region"
aria-label="Example of useEuiScrollBar region"
css={css`
${useEuiScrollBar()}
${logicalCSSWithFallback('overflow-y', 'auto')}
Expand Down Expand Up @@ -125,12 +116,7 @@ export default () => {
paddingSize: 'none',
}}
example={
<div
tabIndex={0}
role="region"
aria-label="Example of euiScrollBar region"
className="guideSass__euiScrollBar"
>
<div tabIndex={0} className="guideSass__euiScrollBar">
<ScrollContent />
</div>
}
Expand Down
5 changes: 1 addition & 4 deletions src-docs/src/views/scroll/scroll_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ export const ScrollExample = {
<p>
To ensure keyboard-only users have access to the scrollable regions,
the optimal solution is to apply <EuiCode>{'tabIndex="0"'}</EuiCode>{' '}
to the region. Add{' '}
<EuiCode language="html">{'role="region"'}</EuiCode> and supply an
accessible name by using <EuiCode language="html">aria-label</EuiCode>{' '}
or another method.{' '}
to the region.{' '}
<EuiLink href="https://dequeuniversity.com/rules/axe/4.1/scrollable-region-focusable">
Learn more about the <EuiCode>scrollable-region-focusable</EuiCode>{' '}
rule at Deque.
Expand Down
18 changes: 2 additions & 16 deletions src-docs/src/views/scroll/scroll_x.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,13 @@ export default () => {
example={
<div
tabIndex={0}
role="region"
aria-label="Example of eui-xScroll region"
className="eui-xScrollWithShadows"
style={{ padding: euiTheme.size.base }}
>
{scrollingContent}
</div>
}
snippet={`<div
tabIndex={0}
role="region"
aria-label=""
className="eui-xScrollWithShadows"
>
snippet={`<div tabIndex={0} className="eui-xScrollWithShadows">
<EuiPanel />
<EuiPanel />
<EuiPanel />
Expand Down Expand Up @@ -94,8 +87,6 @@ export default () => {
example={
<div
tabIndex={0}
role="region"
aria-label="Example of useEuiOverflowScroll(x) region"
css={css`
${useEuiOverflowScroll('x', true)};
padding: ${euiTheme.size.base};
Expand Down Expand Up @@ -130,12 +121,7 @@ export default () => {
paddingSize: 'none',
}}
example={
<div
tabIndex={0}
role="region"
aria-label="Example of euiXScrollWithShadows region"
className="guideSass__overflowShadowsX"
>
<div tabIndex={0} className="guideSass__overflowShadowsX">
{scrollingContent}
</div>
}
Expand Down
18 changes: 2 additions & 16 deletions src-docs/src/views/scroll/scroll_y.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,13 @@ export default () => {
example={
<div
tabIndex={0}
role="region"
aria-label="Example of eui-yScroll region"
className="eui-yScrollWithShadows"
style={{ height: 180 }}
>
<ScrollContent />
</div>
}
snippet={`<div
tabIndex={0}
role="region"
aria-label=""
className="eui-yScrollWithShadows"
>
snippet={`<div tabIndex={0} className="eui-yScrollWithShadows">
<EuiPanel />
<EuiPanel />
<EuiPanel />
Expand Down Expand Up @@ -78,8 +71,6 @@ export default () => {
example={
<div
tabIndex={0}
role="region"
aria-label="Example of useEuiOverflowScroll(y) region"
css={css`
${useEuiOverflowScroll('y', true)}
${logicalCSS('height', '180px')}
Expand Down Expand Up @@ -114,12 +105,7 @@ export default () => {
paddingSize: 'none',
}}
example={
<div
tabIndex={0}
role="region"
aria-label="Example of euiYScrollWithShadows region"
className="guideSass__overflowShadowsY"
>
<div tabIndex={0} className="guideSass__overflowShadowsY">
<ScrollContent />
</div>
}
Expand Down
Loading

0 comments on commit 1a8988c

Please sign in to comment.