From ceef21af20c5bf06bfac71ab1d6f5c2f9cef731e Mon Sep 17 00:00:00 2001 From: Cihan Polat Date: Fri, 3 May 2024 08:17:19 +0200 Subject: [PATCH] fix tieredMenuSub not posititioning itself within viewport --- src/app/components/tieredmenu/tieredmenu.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/components/tieredmenu/tieredmenu.ts b/src/app/components/tieredmenu/tieredmenu.ts index 548643c6a21..7a6c55d147e 100755 --- a/src/app/components/tieredmenu/tieredmenu.ts +++ b/src/app/components/tieredmenu/tieredmenu.ts @@ -192,7 +192,7 @@ import { ObjectUtils, UniqueComponentId, ZIndexUtils } from 'primeng/utils'; class: 'p-element' } }) -export class TieredMenuSub { +export class TieredMenuSub implements AfterContentInit { @Input() items: any[]; @Input() itemTemplate: HTMLElement | undefined; @@ -235,6 +235,10 @@ export class TieredMenuSub { constructor(public el: ElementRef, public renderer: Renderer2, @Inject(forwardRef(() => TieredMenu)) public tieredMenu: TieredMenu) {} + ngAfterContentInit(): void { + this.positionSubmenu(); + } + positionSubmenu() { const sublist = this.sublistViewChild && this.sublistViewChild.nativeElement;