diff --git a/src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.ts b/src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.ts index deed97e6171..66024a2527d 100644 --- a/src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.ts +++ b/src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.ts @@ -159,9 +159,13 @@ export class ExpandableNavbarSectionComponent extends NavbarSectionComponent imp * @param event */ navigateDropdown(event: KeyboardEvent): void { - if (event.key === 'Tab') { + if (event.code === 'Tab') { this.deactivateSection(event, false); return; + } else if (event.code === 'Escape') { + this.deactivateSection(event, false); + (document.querySelector(`a[aria-controls="${this.expandableNavbarSectionId()}"]`) as HTMLElement)?.focus(); + return; } event.preventDefault(); event.stopPropagation();