Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(#13481): add id back to menu item content #13718

Conversation

dalenguyen
Copy link
Contributor

Defect Fixes

Fix #13481

this.items = [
    {
        label: 'New',
        icon: 'pi pi-fw pi-plus'
    },
    {
        id: 'delete',
        label: 'Delete',
        icon: 'pi pi-fw pi-trash'
    }
];

The id="delete" is added correctly to the menu item content.

image

@vercel
Copy link

vercel bot commented Sep 23, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
primeng ⬜️ Ignored (Inspect) Visit Preview Sep 23, 2023 3:20pm

@SaajRP
Copy link

SaajRP commented Sep 23, 2023

PrimeNg team has yet to mention if setting the id to the anchor tag was removed intentionally or if it was done accidentally

Just to note the p-tabMenu, which also uses MenuItem, passes the id to getItemProp function instead of directly assigning the id to the anchor tag
[attr.id]="getItemProp(item, 'id')"

https://github.com/primefaces/primeng/blob/master/src/app/components/tabmenu/tabmenu.ts

@dalenguyen
Copy link
Contributor Author

@SaajRP I can see that the Id is still in the model, allowing us to assign an id to the item. I checked the getItemProp function, it behaves the same way since it will get the property from the object or return undefined.

On a side note, just wonder why the team has to put all functions to the ObjectUtils which will import all functions under it. Wonder if it's treeshakable or not 🤔

@cetincakiroglu
Copy link
Contributor

Hi,

This issue is a duplicate of #13705 and it's fixed in here 44a5075

Closing the issue since it's duplicate and already fixed.

Thanks a lot for your effort and support!

@cetincakiroglu cetincakiroglu added the Resolution: Duplicate Issue has already been reported or a pull request related to same issue has already been submitted label Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Duplicate Issue has already been reported or a pull request related to same issue has already been submitted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Component: p-menu PrimeNg 16.1.0 regression MenuItem.id no longer assigned to MenuItemContent anchor tags
4 participants