mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-18 15:33:04 +00:00
Switch from keyup to keydown to fix spacebar scrolling issue.
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)="$event.stopPropagation(); isActive ? deactivateSection($event) : activateSection($event)"
|
||||
(keydown.enter)="isActive ? deactivateSection($event) : activateSection($event)"
|
||||
(keydown.space)="isActive ? deactivateSection($event) : activateSection($event)"
|
||||
(mouseenter)="activateSection($event)"
|
||||
(mouseleave)="deactivateSection($event)">
|
||||
<a href="#" class="nav-link dropdown-toggle" routerLinkActive="active"
|
||||
|
@@ -86,8 +86,8 @@ describe('ExpandableNavbarSectionComponent', () => {
|
||||
fixture.detectChanges();
|
||||
|
||||
const sidebarToggler = fixture.debugElement.query(By.css('div.nav-item.dropdown'));
|
||||
// dispatch the (keyup.enter) action used in our component HTML
|
||||
sidebarToggler.nativeElement.dispatchEvent(new KeyboardEvent('keyup', { key: 'Enter' }));
|
||||
// dispatch the (keydown.enter) action used in our component HTML
|
||||
sidebarToggler.nativeElement.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter' }));
|
||||
});
|
||||
|
||||
it('should call activateSection on the menuService', () => {
|
||||
@@ -104,8 +104,8 @@ describe('ExpandableNavbarSectionComponent', () => {
|
||||
fixture.detectChanges();
|
||||
|
||||
const sidebarToggler = fixture.debugElement.query(By.css('div.nav-item.dropdown'));
|
||||
// dispatch the (keyup.enter) action used in our component HTML
|
||||
sidebarToggler.nativeElement.dispatchEvent(new KeyboardEvent('keyup', { key: 'Enter' }));
|
||||
// dispatch the (keydown.enter) action used in our component HTML
|
||||
sidebarToggler.nativeElement.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter' }));
|
||||
});
|
||||
|
||||
it('should call deactivateSection on the menuService', () => {
|
||||
@@ -122,8 +122,8 @@ describe('ExpandableNavbarSectionComponent', () => {
|
||||
fixture.detectChanges();
|
||||
|
||||
const sidebarToggler = fixture.debugElement.query(By.css('div.nav-item.dropdown'));
|
||||
// dispatch the (keyup.space) action used in our component HTML
|
||||
sidebarToggler.nativeElement.dispatchEvent(new KeyboardEvent('keyup', { key: ' ' }));
|
||||
// dispatch the (keydown.space) action used in our component HTML
|
||||
sidebarToggler.nativeElement.dispatchEvent(new KeyboardEvent('keydown', { key: ' ' }));
|
||||
});
|
||||
|
||||
it('should call activateSection on the menuService', () => {
|
||||
@@ -140,8 +140,8 @@ describe('ExpandableNavbarSectionComponent', () => {
|
||||
fixture.detectChanges();
|
||||
|
||||
const sidebarToggler = fixture.debugElement.query(By.css('div.nav-item.dropdown'));
|
||||
// dispatch the (keyup.space) action used in our component HTML
|
||||
sidebarToggler.nativeElement.dispatchEvent(new KeyboardEvent('keyup', { key: ' ' }));
|
||||
// dispatch the (keydown.space) action used in our component HTML
|
||||
sidebarToggler.nativeElement.dispatchEvent(new KeyboardEvent('keydown', { key: ' ' }));
|
||||
});
|
||||
|
||||
it('should call deactivateSection on the menuService', () => {
|
||||
|
Reference in New Issue
Block a user