Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/primefaces/primeng
Browse files Browse the repository at this point in the history
  • Loading branch information
cetincakiroglu committed Mar 22, 2024
2 parents bdcef86 + 5f68663 commit d7d7a11
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/app/components/tieredmenu/tieredmenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,10 @@ export class TieredMenuSub {

@ViewChild('sublist', { static: true }) sublistViewChild: ElementRef;

constructor(public el: ElementRef, public renderer: Renderer2, private cd: ChangeDetectorRef, @Inject(forwardRef(() => TieredMenu)) public tieredMenu: TieredMenu) {}
constructor(public el: ElementRef, public renderer: Renderer2, @Inject(forwardRef(() => TieredMenu)) public tieredMenu: TieredMenu) {}

positionSubmenu() {
let sublist = this.sublistViewChild && this.sublistViewChild.nativeElement;
const sublist = this.sublistViewChild && this.sublistViewChild.nativeElement;

if (sublist) {
const parentItem = sublist.parentElement.parentElement;
Expand Down Expand Up @@ -506,8 +506,6 @@ export class TieredMenu implements OnInit, AfterContentInit, OnDestroy {

relativeAlign: boolean | undefined;

private window: Window;

dirty: boolean = false;

focused: boolean = false;
Expand Down Expand Up @@ -552,7 +550,6 @@ export class TieredMenu implements OnInit, AfterContentInit, OnDestroy {
public config: PrimeNGConfig,
public overlayService: OverlayService
) {
this.window = this.document.defaultView as Window;
effect(() => {
const path = this.activeItemPath();

Expand Down Expand Up @@ -860,7 +857,6 @@ export class TieredMenu implements OnInit, AfterContentInit, OnDestroy {

anchorElement ? anchorElement.click() : element && element.click();

const processedItem = this.visibleItems[this.focusedItemInfo().index];
if (!this.popup) {
const processedItem = this.visibleItems[this.focusedItemInfo().index];
const grouped = this.isProccessedItemGroup(processedItem);
Expand Down Expand Up @@ -891,8 +887,6 @@ export class TieredMenu implements OnInit, AfterContentInit, OnDestroy {

onMenuFocus(event: any) {
this.focused = true;
const focusedItemInfo = this.focusedItemInfo().index !== -1 ? this.focusedItemInfo() : { index: this.findFirstFocusedItemIndex(), level: 0, parentKey: '', item: this.visibleItems[this.findFirstFocusedItemIndex()]?.item };
this.focusedItemInfo.set(focusedItemInfo);
}

onMenuBlur(event: any) {
Expand Down Expand Up @@ -996,7 +990,7 @@ export class TieredMenu implements OnInit, AfterContentInit, OnDestroy {
this.relativeAlign = event?.relativeAlign || null;
}

this.focusedItemInfo.set({ index: this.findFirstFocusedItemIndex(), level: 0, parentKey: '' });
this.focusedItemInfo.set({ index: -1, level: 0, parentKey: '' });

isFocus && DomHandler.focus(this.rootmenu.sublistViewChild.nativeElement);

Expand Down

0 comments on commit d7d7a11

Please sign in to comment.