Skip to content

Commit c64800a

Browse files
Andrew-K-Lamagorovyi
authored andcommitted
fix(community-side-navigation): fix accessibility voice over issue
1 parent 2affdbd commit c64800a

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

packages/SideNavigation/SubMenu/SubMenu.jsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,12 @@ class SubMenu extends React.Component {
8383

8484
return (
8585
<div>
86-
<ButtonSubMenu {...safeRest(rest)} onClick={this.handleClick} active={active}>
86+
<ButtonSubMenu
87+
{...safeRest(rest)}
88+
onClick={this.handleClick}
89+
active={active}
90+
aria-expanded={isOpen}
91+
>
8792
<SpaceBox vertical={3} inline horizontal={2}>
8893
<ColoredTextProvider>
8994
<Text size="medium" bold={active}>

packages/SideNavigation/SubMenu/__tests__/__snapshots__/SubMenu.spec.jsx.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ exports[`SideNavigation.SubMenu renders 1`] = `
44
<div>
55
<styled.button
66
active={true}
7+
aria-expanded={false}
78
id="Three"
89
onClick={[Function]}
910
>

packages/SideNavigation/__tests__/__snapshots__/SideNavigation.spec.jsx.snap

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ exports[`SideNavigation renders 1`] = `
318318
>
319319
<div>
320320
<button
321+
aria-expanded="false"
321322
class="c6"
322323
id="TDS-SideNavigation-3"
323324
>
@@ -1032,12 +1033,14 @@ exports[`SideNavigation renders 1`] = `
10321033
<div>
10331034
<styled.button
10341035
active={false}
1036+
aria-expanded={false}
10351037
handleToggleSubMenu={[Function]}
10361038
id="TDS-SideNavigation-3"
10371039
onClick={[Function]}
10381040
>
10391041
<StyledComponent
10401042
active={false}
1043+
aria-expanded={false}
10411044
forwardedComponent={
10421045
Object {
10431046
"$$typeof": Symbol(react.forward_ref),
@@ -1066,6 +1069,7 @@ exports[`SideNavigation renders 1`] = `
10661069
onClick={[Function]}
10671070
>
10681071
<button
1072+
aria-expanded={false}
10691073
className="c7"
10701074
id="TDS-SideNavigation-3"
10711075
onClick={[Function]}
@@ -1964,6 +1968,7 @@ exports[`SideNavigation renders without vertical spacing 1`] = `
19641968
>
19651969
<div>
19661970
<button
1971+
aria-expanded="true"
19671972
class="c6"
19681973
id="TDS-SideNavigation-1"
19691974
>
@@ -2281,12 +2286,14 @@ exports[`SideNavigation renders without vertical spacing 1`] = `
22812286
<div>
22822287
<styled.button
22832288
active={true}
2289+
aria-expanded={true}
22842290
handleToggleSubMenu={[Function]}
22852291
id="TDS-SideNavigation-1"
22862292
onClick={[Function]}
22872293
>
22882294
<StyledComponent
22892295
active={true}
2296+
aria-expanded={true}
22902297
forwardedComponent={
22912298
Object {
22922299
"$$typeof": Symbol(react.forward_ref),
@@ -2315,6 +2322,7 @@ exports[`SideNavigation renders without vertical spacing 1`] = `
23152322
onClick={[Function]}
23162323
>
23172324
<button
2325+
aria-expanded={true}
23182326
className="c7"
23192327
id="TDS-SideNavigation-1"
23202328
onClick={[Function]}

0 commit comments

Comments
 (0)