Allow enter key to expand or contract menu based on current active status

This commit is contained in:
Tim Donohue
2021-09-14 14:16:04 -05:00
parent 706cc47197
commit b86ae8dd14

View File

@@ -1,5 +1,6 @@
<div class="nav-item dropdown expandable-navbar-section" <ng-container *ngVar="(active | async) as isActive">
(keyup.enter)="activateSection($event)" <div class="nav-item dropdown expandable-navbar-section"
(keyup.enter)="isActive ? deactivateSection($event) : activateSection($event)"
(mouseenter)="activateSection($event)" (mouseenter)="activateSection($event)"
(mouseleave)="deactivateSection($event)"> (mouseleave)="deactivateSection($event)">
<a href="#" class="nav-link dropdown-toggle" routerLinkActive="active" <a href="#" class="nav-link dropdown-toggle" routerLinkActive="active"
@@ -15,4 +16,5 @@
*ngComponentOutlet="(sectionMap$ | async).get(subSection.id).component; injector: (sectionMap$ | async).get(subSection.id).injector;"></ng-container> *ngComponentOutlet="(sectionMap$ | async).get(subSection.id).component; injector: (sectionMap$ | async).get(subSection.id).injector;"></ng-container>
</ng-container> </ng-container>
</ul> </ul>
</div> </div>
</ng-container>