116404: Fixed expandable navbar section loosing focus on expand through keyboard

(cherry picked from commit 2547b1218f)
This commit is contained in:
Alexandre Vryghem
2024-07-05 10:34:49 +02:00
committed by github-actions[bot]
parent bb977dcd49
commit ed27231769
4 changed files with 15 additions and 17 deletions

View File

@@ -37,9 +37,9 @@ import { MenuSection } from '../menu-section.model';
export class MenuSectionComponent implements OnInit, OnDestroy {
/**
* Observable that emits whether or not this section is currently active
* {@link BehaviorSubject} containing the current state to whether this section is currently active
*/
active: Observable<boolean>;
active$: BehaviorSubject<boolean> = new BehaviorSubject(false);
/**
* The ID of the menu this section resides in
@@ -72,7 +72,9 @@ export class MenuSectionComponent implements OnInit, OnDestroy {
* Set initial values for instance variables
*/
ngOnInit(): void {
this.active = this.menuService.isSectionActive(this.menuID, this.section.id).pipe(distinctUntilChanged());
this.menuService.isSectionActive(this.menuID, this.section.id).pipe(distinctUntilChanged()).subscribe((isActive: boolean) => {
this.active$.next(isActive);
});
this.initializeInjectorData();
}