mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-14 21:43:04 +00:00
116404: Fixed expandable navbar section loosing focus on expand through keyboard
(cherry picked from commit 2547b1218f
)
This commit is contained in:

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
bb977dcd49
commit
ed27231769
@@ -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();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user