mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-18 07:23:03 +00:00
116404: Fixed expandable navbar section loosing focus on expand through keyboard
(cherry picked from commit 2547b1218f
)
This commit is contained in:
@@ -20,9 +20,9 @@ import { MenuItemType } from '../menu-item-type.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
|
||||
@@ -55,7 +55,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();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user