Skip to content

Commit c26d12f

Browse files
Adding aria-current to the anchor tag of the selected item for VerticalNavigation (#2748)
* add aria-current * use undefined Co-authored-by: Stephen James <[email protected]>
1 parent d04a707 commit c26d12f

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

components/vertical-navigation/__docs__/__snapshots__/storybook-stories.storyshot

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ exports[`DOM snapshots SLDSVerticalNavigation DOM Snapshot 1`] = `
2222
className="slds-nav-vertical__item slds-is-active"
2323
>
2424
<a
25+
aria-current={true}
2526
aria-describedby="sample-navigation-reports"
2627
className="slds-nav-vertical__action"
2728
data-id="recent_reports"
@@ -169,6 +170,7 @@ exports[`DOM snapshots SLDSVerticalNavigation Default 1`] = `
169170
className="slds-nav-vertical__item slds-is-active"
170171
>
171172
<a
173+
aria-current={true}
172174
aria-describedby="sample-navigation-reports"
173175
className="slds-nav-vertical__action"
174176
data-id="recent_reports"

components/vertical-navigation/private/item.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ const Item = (props) => (
3434
href={props.item.url || 'javascript:void(0);'} // eslint-disable-line no-script-url
3535
className="slds-nav-vertical__action"
3636
aria-describedby={props.categoryId}
37+
aria-current={props.isSelected ? true : undefined}
3738
onClick={(event) => {
3839
handleClick(event, props);
3940
}}

0 commit comments

Comments
 (0)