Skip to content

Commit

Permalink
accesibility
Browse files Browse the repository at this point in the history
  • Loading branch information
CrisGuzmanS committed Dec 8, 2023
1 parent 8ba14aa commit 1da9db8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
(keyup.space)="isActive ? deactivateSection($event) : activateSection($event)"
(keydown.space)="$event.preventDefault()"
(mouseenter)="activateSection($event)"
(mouseleave)="deactivateSection($event)">
(mouseleave)="deactivateSection($event)"
aria-haspopup="menu"
aria-expanded="false">
<button class="btn btn-link nav-link dropdown-toggle" routerLinkActive="active" type="button"
[class.disabled]="section.model?.disabled"
(click)="toggleSection($event)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,17 @@ export class ExpandableNavbarSectionComponent extends NavbarSectionComponent imp
* @param {Event} event The user event that triggered this function
*/
activateSection(event): void {

console.log(event.target);

Check failure on line 44 in src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.ts

View workflow job for this annotation

GitHub Actions / tests (16.x)

Trailing spaces not allowed

Check failure on line 44 in src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.ts

View workflow job for this annotation

GitHub Actions / tests (18.x)

Trailing spaces not allowed

this.windowService.isXsOrSm().pipe(
first()
).subscribe((isMobile) => {
if (!isMobile) {
const targetElement = event.target as HTMLElement;
super.activateSection(event);
targetElement.setAttribute('aria-expanded', 'true');

Check failure on line 52 in src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.ts

View workflow job for this annotation

GitHub Actions / tests (16.x)

Trailing spaces not allowed

Check failure on line 52 in src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.ts

View workflow job for this annotation

GitHub Actions / tests (18.x)

Trailing spaces not allowed
}
});
}
Expand All @@ -58,7 +64,9 @@ export class ExpandableNavbarSectionComponent extends NavbarSectionComponent imp
first()
).subscribe((isMobile) => {
if (!isMobile) {
const targetElement = event.target as HTMLElement;
super.deactivateSection(event);
targetElement.setAttribute('aria-expanded', 'false');

Check failure on line 69 in src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.ts

View workflow job for this annotation

GitHub Actions / tests (16.x)

Trailing spaces not allowed

Check failure on line 69 in src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.ts

View workflow job for this annotation

GitHub Actions / tests (18.x)

Trailing spaces not allowed
}
});
}
Expand Down

0 comments on commit 1da9db8

Please sign in to comment.