Skip to content

Commit

Permalink
Fixed #9458 - TieredMenu initial hover is broken
Browse files Browse the repository at this point in the history
  • Loading branch information
cagataycivici committed Nov 17, 2020
1 parent d8ac43a commit eb884e5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/app/components/tieredmenu/tieredmenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { animate, style, transition, trigger, AnimationEvent } from '@angular/an
<ng-template #htmlRouteLabel><span class="p-menuitem-text" [innerHTML]="child.label"></span></ng-template>
<span class="p-submenu-icon pi pi-angle-right" *ngIf="child.items"></span>
</a>
<p-tieredMenuSub (keydownItem)="onChildItemKeyDown($event)" [parentActive]="child === activeItem" [item]="child" *ngIf="child.items" [mobileActive]="mobileActive" [autoDisplay]="autoDisplay" (leafClick)="onLeafClick()"></p-tieredMenuSub>
<p-tieredMenuSub (keydownItem)="onChildItemKeyDown($event)" [parentActive]="child === activeItem" [item]="child" *ngIf="child.items" [mobileActive]="mobileActive" [autoDisplay]="autoDisplay" (leafClick)="onLeafClick()" [popup]="popup"></p-tieredMenuSub>
</li>
</ng-template>
</ul>
Expand All @@ -52,6 +52,8 @@ export class TieredMenuSub implements OnDestroy {

@Input() mobileActive: boolean;

@Input() popup: boolean;

@Input() get parentActive():boolean
{
return this._parentActive;
Expand Down Expand Up @@ -121,7 +123,7 @@ export class TieredMenuSub implements OnDestroy {
}

if (this.root) {
if (this.activeItem || this.autoDisplay) {
if (this.activeItem || this.autoDisplay || this.popup) {
this.activeItem = item;
this.bindDocumentClickListener();
}
Expand Down Expand Up @@ -251,7 +253,8 @@ export class TieredMenuSub implements OnDestroy {
<div [ngClass]="{'p-tieredmenu p-component':true, 'p-tieredmenu-overlay':popup}" [class]="styleClass" [ngStyle]="style"
[@overlayAnimation]="{value: 'visible', params: {showTransitionParams: showTransitionOptions, hideTransitionParams: hideTransitionOptions}}" [@.disabled]="popup !== true"
(@overlayAnimation.start)="onOverlayAnimationStart($event)" (click)="preventDocumentDefault=true" *ngIf="!popup || visible">
<p-tieredMenuSub [item]="model" root="root" [parentActive]="parentActive" [baseZIndex]="baseZIndex" [autoZIndex]="autoZIndex" (leafClick)="onLeafClick()" [autoDisplay]="autoDisplay"></p-tieredMenuSub>
<p-tieredMenuSub [item]="model" root="root" [parentActive]="parentActive" [baseZIndex]="baseZIndex" [autoZIndex]="autoZIndex" (leafClick)="onLeafClick()"
[autoDisplay]="autoDisplay" [popup]="popup"></p-tieredMenuSub>
</div>
`,
animations: [
Expand Down

0 comments on commit eb884e5

Please sign in to comment.