Attempt to stop scroll to bottom of page when clicking spacebar

This commit is contained in:
Tim Donohue
2021-09-30 17:11:34 -05:00
parent e5e6e9c07a
commit 7747a8c4e2
2 changed files with 3 additions and 1 deletions

View File

@@ -1,7 +1,7 @@
<div class="nav-item dropdown expandable-navbar-section"
*ngVar="(active | async) as isActive"
(keyup.enter)="isActive ? deactivateSection($event) : activateSection($event)"
(keyup.space)="isActive ? deactivateSection($event) : activateSection($event)"
(keyup.space)="$event.stopPropagation(); isActive ? deactivateSection($event) : activateSection($event)"
(mouseenter)="activateSection($event)"
(mouseleave)="deactivateSection($event)">
<a href="#" class="nav-link dropdown-toggle" routerLinkActive="active"

View File

@@ -42,6 +42,7 @@ export class ExpandableNavbarSectionComponent extends NavbarSectionComponent imp
* @param {Event} event The user event that triggered this function
*/
activateSection(event): void {
event.preventDefault();
this.windowService.isXsOrSm().pipe(
first()
).subscribe((isMobile) => {
@@ -57,6 +58,7 @@ export class ExpandableNavbarSectionComponent extends NavbarSectionComponent imp
* @param {Event} event The user event that triggered this function
*/
deactivateSection(event): void {
event.preventDefault();
this.windowService.isXsOrSm().pipe(
first()
).subscribe((isMobile) => {