Skip to content

Commit

Permalink
Fixed primefaces#15367 - Non-linear menu items are misaligned
Browse files Browse the repository at this point in the history
  • Loading branch information
Dive576 authored and nbrown-ScottLogic committed May 1, 2024
1 parent e7c9fa3 commit 9a2a467
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 8 additions & 0 deletions src/app/components/speeddial/speeddial.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
z-index: 1;
}

.p-speeddial:not(.p-speeddial-opened) {
pointer-events: none;
}

.p-speeddial:not(.p-speeddial-opened) .p-speeddial-button {
pointer-events: auto;
}

.p-speeddial-list {
margin: 0;
padding: 0;
Expand Down
5 changes: 2 additions & 3 deletions src/app/components/speeddial/speeddial.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ import { asapScheduler } from 'rxjs';
</ng-container>
<ng-container *ngIf="!itemTemplate">
<a
*ngIf="_visible && isClickableRouterLink(item); else elseBlock"
*ngIf="isClickableRouterLink(item); else elseBlock"
pRipple
[routerLink]="item.routerLink"
[queryParams]="item.queryParams"
Expand All @@ -117,7 +117,6 @@ import { asapScheduler } from 'rxjs';
</a>
<ng-template #elseBlock>
<a
*ngIf="_visible"
[attr.href]="item.url || null"
class="p-speeddial-action"
role="menuitem"
Expand Down Expand Up @@ -499,7 +498,7 @@ export class SpeedDial implements AfterViewInit, AfterContentInit, OnDestroy {

onEnterKey(event: any) {
const items = DomHandler.find(this.container.nativeElement, '[data-pc-section="menuitem"]');
const itemIndex = [...items].findIndex((item) => item.id === this.focusedOptionIndex);
const itemIndex = [...items].findIndex((item) => item.id === this.focusedOptionIndex());

this.onItemClick(event, this.model[itemIndex]);
this.onBlur(event);
Expand Down

0 comments on commit 9a2a467

Please sign in to comment.