Skip to content

Commit

Permalink
Fixed primefaces#13870 - Replace property binding with attribute binding
Browse files Browse the repository at this point in the history
  • Loading branch information
cetincakiroglu committed Oct 12, 2023
1 parent 10ff8dc commit 1483287
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 22 deletions.
8 changes: 4 additions & 4 deletions src/app/components/contextmenu/contextmenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import { Nullable, VoidListener } from 'primeng/ts-helpers';
[ngClass]="{ 'p-submenu-list': !root, 'p-contextmenu-root-list': root }"
[@overlayAnimation]="visible"
(@overlayAnimation.start)="onEnter($event, sublist)"
[id]="menuId + '_list'"
[attr.id]="menuId + '_list'"
[tabindex]="tabindex"
[attr.aria-label]="ariaLabel"
[attr.aria-labelledBy]="ariaLabelledBy"
Expand All @@ -61,7 +61,7 @@ import { Nullable, VoidListener } from 'primeng/ts-helpers';
<ng-template ngFor let-processedItem [ngForOf]="items" let-index="index">
<li
*ngIf="isItemVisible(processedItem) && getItemProp(processedItem, 'separator')"
[id]="getItemId(processedItem)"
[attr.id]="getItemId(processedItem)"
[style]="getItemProp(processedItem, 'style')"
[ngClass]="getSeparatorItemClass(processedItem)"
role="separator"
Expand All @@ -71,7 +71,7 @@ import { Nullable, VoidListener } from 'primeng/ts-helpers';
#listItem
*ngIf="isItemVisible(processedItem) && !getItemProp(processedItem, 'separator')"
role="menuitem"
[id]="getItemId(processedItem)"
[attr.id]="getItemId(processedItem)"
[attr.data-pc-section]="'menuitem'"
[attr.data-p-highlight]="isItemActive(processedItem)"
[attr.data-p-focused]="isItemFocused(processedItem)"
Expand Down Expand Up @@ -339,7 +339,7 @@ export class ContextMenuSub {
#container
[attr.data-pc-section]="'root'"
[attr.data-pc-name]="'contextmenu'"
[id]="id"
[attr.id]="id"
[ngClass]="{ 'p-contextmenu p-component': true, 'p-contextmenu-overlay': true }"
[class]="styleClass"
[ngStyle]="style"
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/dock/dock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { DomHandler } from 'primeng/dom';
<div class="p-dock-list-container">
<ul
#list
[id]="id"
[attr.id]="id"
class="p-dock-list"
role="menu"
[attr.aria-orientation]="position === 'bottom' || position === 'top' ? 'horizontal' : 'vertical'"
Expand Down
10 changes: 5 additions & 5 deletions src/app/components/megamenu/megamenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import { ObjectUtils, UniqueComponentId } from 'primeng/utils';
#menubar
[ngClass]="{ 'p-megamenu-root-list': root, 'p-submenu-list p-megamenu-submenu': !root }"
[attr.role]="root ? 'menubar' : 'menu'"
[id]="id"
[attr.id]="id"
[attr.aria-orientation]="orientation"
[tabindex]="tabindex"
[attr.aria-activedescendant]="focusedItemId"
Expand All @@ -53,7 +53,7 @@ import { ObjectUtils, UniqueComponentId } from 'primeng/utils';
<ng-template ngFor let-processedItem [ngForOf]="items" let-index="index">
<li
*ngIf="isItemVisible(processedItem) && getItemProp(processedItem, 'separator')"
[id]="getItemId(processedItem)"
[attr.id]="getItemId(processedItem)"
[style]="getItemProp(processedItem, 'style')"
[ngClass]="getSeparatorItemClass(processedItem)"
role="separator"
Expand All @@ -63,7 +63,7 @@ import { ObjectUtils, UniqueComponentId } from 'primeng/utils';
#listItem
*ngIf="isItemVisible(processedItem) && !getItemProp(processedItem, 'separator')"
role="menuitem"
[id]="getItemId(processedItem)"
[attr.id]="getItemId(processedItem)"
[attr.data-pc-section]="'menuitem'"
[attr.data-p-highlight]="isItemActive(processedItem)"
[attr.data-p-focused]="isItemFocused(processedItem)"
Expand Down Expand Up @@ -350,15 +350,15 @@ export class MegaMenuSub {
[ngStyle]="style"
[attr.data-pc-section]="'root'"
[attr.data-pc-name]="'megamenu'"
[id]="id"
[attr.id]="id"
>
<div class="p-megamenu-start" *ngIf="startTemplate">
<ng-container *ngTemplateOutlet="startTemplate"></ng-container>
</div>
<p-megaMenuSub
#rootmenu
[items]="processedItems"
[id]="id + '_list'"
[attr.id]="id + '_list'"
[menuId]="id"
[root]="true"
[orientation]="orientation"
Expand Down
6 changes: 2 additions & 4 deletions src/app/components/menu/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,13 @@ export class MenuItemContent {
(@overlayAnimation.start)="onOverlayAnimationStart($event)"
(@overlayAnimation.done)="onOverlayAnimationEnd($event)"
[attr.data-pc-name]="'menu'"
[id]="id"
[attr.id]="id"
>
<ul
#list
class="p-menu-list p-reset"
role="menu"
[id]="id + '_list'"
[attr.id]="id + '_list'"
[tabindex]="tabindex"
[attr.data-pc-section]="'menu'"
[attr.aria-activedescendant]="activedescendant()"
Expand Down Expand Up @@ -192,7 +192,6 @@ export class MenuItemContent {
[attr.data-p-disabled]="disabled(item.disabled)"
[attr.aria-disabled]="disabled(item.disabled)"
[attr.id]="menuitemId(item, id, i, j)"
[id]="menuitemId(item, id, i, j)"
></li>
</ng-template>
</ng-template>
Expand All @@ -215,7 +214,6 @@ export class MenuItemContent {
[attr.data-p-disabled]="disabled(item.disabled)"
[attr.aria-disabled]="disabled(item.disabled)"
[attr.id]="menuitemId(item, id, i)"
[id]="menuitemId(item, id, i)"
></li>
</ng-template>
</ul>
Expand Down
6 changes: 3 additions & 3 deletions src/app/components/menubar/menubar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ export class MenubarService {
[attr.aria-label]="ariaLabel"
[attr.aria-labelledBy]="ariaLabelledBy"
(keydown)="menuKeydown.emit($event)"
[id]="menuId"
[attr.id]="menuId"
[attr.aria-activedescendant]="focusedItemId"
>
<ng-template ngFor let-processedItem [ngForOf]="items" let-index="index">
<li
*ngIf="isItemVisible(processedItem) && getItemProp(processedItem, 'separator')"
[id]="getItemId(processedItem)"
[attr.id]="getItemId(processedItem)"
[style]="getItemProp(processedItem, 'style')"
[ngClass]="getSeparatorItemClass(processedItem)"
role="separator"
Expand All @@ -80,7 +80,7 @@ export class MenubarService {
#listItem
*ngIf="isItemVisible(processedItem) && !getItemProp(processedItem, 'separator')"
role="menuitem"
[id]="getItemId(processedItem)"
[attr.id]="getItemId(processedItem)"
[attr.data-pc-section]="'menuitem'"
[attr.data-p-highlight]="isItemActive(processedItem)"
[attr.data-p-focused]="isItemFocused(processedItem)"
Expand Down
6 changes: 3 additions & 3 deletions src/app/components/panelmenu/panelmenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import { ObjectUtils, UniqueComponentId } from 'primeng/utils';
*ngIf="!processedItem.separator && isItemVisible(processedItem)"
[ngClass]="getItemClass(processedItem)"
role="treeitem"
[id]="getItemId(processedItem)"
[attr.id]="getItemId(processedItem)"
[attr.aria-label]="getItemProp(processedItem, 'label')"
[attr.aria-expanded]="isItemGroup(processedItem) ? isItemActive(processedItem) : undefined"
[attr.aria-level]="level + 1"
Expand Down Expand Up @@ -698,7 +698,7 @@ export class PanelMenuList implements OnChanges {
[class]="getItemProp(item, 'styleClass')"
[ngStyle]="getItemProp(item, 'style')"
[pTooltip]="getItemProp(item, 'tooltip')"
[id]="getHeaderId(item, i)"
[attr.id]="getHeaderId(item, i)"
[tabindex]="0"
role="button"
[tooltipOptions]="getItemProp(item, 'tooltipOptions')"
Expand Down Expand Up @@ -772,7 +772,7 @@ export class PanelMenuList implements OnChanges {
[@rootItem]="getAnimation(item)"
(@rootItem.done)="onToggleDone()"
role="region"
[id]="getContentId(item, i)"
[attr.id]="getContentId(item, i)"
[attr.aria-labelledby]="getHeaderId(item, i)"
[attr.data-pc-section]="'toggleablecontent'"
>
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/tieredmenu/tieredmenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ import { ObjectUtils, UniqueComponentId, ZIndexUtils } from 'primeng/utils';
<ng-template ngFor let-processedItem [ngForOf]="items" let-index="index">
<li
*ngIf="isItemVisible(processedItem) && getItemProp(processedItem, 'separator')"
[id]="getItemId(processedItem)"
[attr.id]="getItemId(processedItem)"
[style]="getItemProp(processedItem, 'style')"
[ngClass]="getSeparatorItemClass(processedItem)"
role="separator"
Expand All @@ -65,7 +65,7 @@ import { ObjectUtils, UniqueComponentId, ZIndexUtils } from 'primeng/utils';
#listItem
*ngIf="isItemVisible(processedItem) && !getItemProp(processedItem, 'separator')"
role="menuitem"
[id]="getItemId(processedItem)"
[attr.id]="getItemId(processedItem)"
[attr.data-pc-section]="'menuitem'"
[attr.data-p-highlight]="isItemActive(processedItem)"
[attr.data-p-focused]="isItemFocused(processedItem)"
Expand Down

0 comments on commit 1483287

Please sign in to comment.