Skip to content

Commit 3cf48bf

Browse files
committed
fix(sidebar-nav): role="navigation"
1 parent 3156663 commit 3cf48bf

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

projects/coreui-angular/src/lib/sidebar/sidebar-nav/sidebar-nav.component.ts

+18-15
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,23 @@ import { IconDirective } from '@coreui/icons-angular';
5252
],
5353
animations: [
5454
trigger('openClose', [
55-
state('open', style({
56-
height: '*'
57-
})),
58-
state('closed', style({
59-
height: '0px'
60-
})),
61-
transition('open <=> closed', [
62-
animate('.15s ease')
63-
])
55+
state(
56+
'open',
57+
style({
58+
height: '*'
59+
})
60+
),
61+
state(
62+
'closed',
63+
style({
64+
height: '0px'
65+
})
66+
),
67+
transition('open <=> closed', [animate('.15s ease')])
6468
])
6569
]
6670
})
6771
export class SidebarNavGroupComponent implements OnInit, OnDestroy {
68-
6972
constructor(
7073
private router: Router,
7174
private renderer: Renderer2,
@@ -102,7 +105,6 @@ export class SidebarNavGroupComponent implements OnInit, OnDestroy {
102105
public display: any = { display: 'block' };
103106

104107
ngOnInit(): void {
105-
106108
this.navItems = [...this.item.children];
107109

108110
this.navSubscription = this.navigationEndObservable.subscribe((event: NavigationEnd) => {
@@ -116,7 +118,7 @@ export class SidebarNavGroupComponent implements OnInit, OnDestroy {
116118
this.openGroup(true);
117119
}
118120

119-
this.navGroupSubscription = this.sidebarNavGroupService.sidebarNavGroupState$.subscribe(next => {
121+
this.navGroupSubscription = this.sidebarNavGroupService.sidebarNavGroupState$.subscribe((next) => {
120122
if (this.dropdownMode === 'close' && next.sidebarNavGroup && next.sidebarNavGroup !== this) {
121123
if (next.sidebarNavGroup.item.url.startsWith(this.item.url)) {
122124
return;
@@ -194,15 +196,14 @@ export class SidebarNavGroupComponent implements OnInit, OnDestroy {
194196
]
195197
})
196198
export class SidebarNavComponent implements OnChanges {
197-
198199
constructor(
199200
@Optional() public sidebar: SidebarComponent,
200201
public helper: SidebarNavHelper,
201202
public router: Router,
202203
private renderer: Renderer2,
203204
private hostElement: ElementRef,
204205
private sidebarService: SidebarService
205-
) { }
206+
) {}
206207

207208
@Input() navItems?: INavData[] = [];
208209
@Input() dropdownMode: 'path' | 'none' | 'close' = 'path';
@@ -223,7 +224,9 @@ export class SidebarNavComponent implements OnChanges {
223224
// return !!this.groupItems;
224225
// }
225226

226-
@HostBinding('attr.role') role = 'nav';
227+
@HostBinding('attr.role')
228+
@Input()
229+
role = 'navigation';
227230

228231
public navItemsArray: INavData[] = [];
229232

0 commit comments

Comments
 (0)