Skip to content

Commit

Permalink
fix(a11y): vertical nav - remove incorrect usage of links at top leve…
Browse files Browse the repository at this point in the history
…l for the vertical nav story (#1455)

## PR Checklist

Please check if your PR fulfills the following requirements:

- [ ] Tests for the changes have been added (for bug fixes / features)
- [x] Docs have been added / updated (for bug fixes / features)
- [ ] If applicable, have a visual design approval

## PR Type

What kind of change does this PR introduce?

<!-- Please check the one that applies to this PR using "x". -->

- [x] Bugfix
- [ ] Feature
- [ ] Code style update (formatting, local variables)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] CI related changes
- [ ] Documentation content changes
- [ ] Other... Please describe:

## What is the current behavior?
This is a bug in the vertical nav routing story, and not the vertical
nav component. Links are used in the top level for the nav with routing
story which results in an independent accordion icon button being added
to the DOM that has state but no label.
The top-level entries should not be links. That usage is incorrect and
breaks the component.

<!-- Please describe the current behavior that you are modifying, or
link to a relevant issue. -->

Issue Number: [CDE-1390](https://jira.eng.vmware.com/browse/CDE-1390)

## What is the new behavior?

## Does this PR introduce a breaking change?

- [ ] Yes
- [x] No

<!-- If this PR contains a breaking change, please describe the impact
and migration path for existing applications below. -->

## Other information
This will fix related bug :
[CDE-1391](https://jira.eng.vmware.com/browse/CDE-1391)

---------

Co-authored-by: Andrea Fernandes <[email protected]>
Co-authored-by: GitHub <[email protected]>
  • Loading branch information
3 people authored Jun 20, 2024
1 parent 403a827 commit b21e36e
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 24 deletions.
32 changes: 8 additions & 24 deletions .storybook/stories/vertical-nav/vertical-nav-routing.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,19 +122,11 @@ const NavRoutingTemplate: StoryFn = args => ({
>
<clr-vertical-nav-group
*ngFor="let navLink of navLinks"
[ngClass]="{ active: navLink.text.toLowerCase() == activeRoute }"
[clrVerticalNavGroupExpanded]="clrVerticalNavGroupExpanded"
(clrVerticalNavGroupExpandedChange)="clrVerticalNavGroupExpandedChange($event)"
>
<a
(click)="handleClick($event, navLink.text.toLowerCase())"
[ngClass]="{ active: navLink.text.toLowerCase() == activeRoute }"
clrVerticalNavLink
href="javascript:void(0)"
>
<cds-icon *ngIf="includeIcons" [attr.shape]="navLink.iconShapeTuple[0]" clrVerticalNavIcon></cds-icon>
{{ navLink.text }}
</a>
<cds-icon *ngIf="includeIcons" [attr.shape]="navLink.iconShapeTuple[0]" clrVerticalNavIcon></cds-icon>
{{ navLink.text }}
<clr-vertical-nav-group-children>
<a
clrVerticalNavLink
Expand Down Expand Up @@ -165,23 +157,15 @@ const NavRoutingAllTemplate: StoryFn = args => ({
>
<clr-vertical-nav-group
*ngFor="let navLink of navLinks"
[ngClass]="{ active: navLink.text.toLowerCase() == activeRoute }"
[clrVerticalNavGroupExpanded]="state?.clrVerticalNavGroupExpanded"
(clrVerticalNavGroupExpandedChange)="clrVerticalNavGroupExpandedChange($event)"
>
<a
(click)="handleClick($event, navLink.text.toLowerCase())"
[ngClass]="{ active: navLink.text.toLowerCase() == activeRoute }"
clrVerticalNavLink
href="javascript:void(0)"
>
<cds-icon
*ngIf="state?.includeIcons"
[attr.shape]="navLink.iconShapeTuple[0]"
clrVerticalNavIcon
></cds-icon>
{{ navLink.text }}
</a>
<cds-icon
*ngIf="state?.includeIcons"
[attr.shape]="navLink.iconShapeTuple[0]"
clrVerticalNavIcon
></cds-icon>
{{ navLink.text }}
<clr-vertical-nav-group-children>
<a
clrVerticalNavLink
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b21e36e

Please sign in to comment.