mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Attempt to stop scroll to bottom of page when clicking spacebar
This commit is contained in:
@@ -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"
|
||||
|
@@ -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) => {
|
||||
|
Reference in New Issue
Block a user