-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Menu Breadcrumbs: Inline SVG in the label as HTML is not rendered #15228
Comments
The motivation of this is to customize the home of the Breadcrumbs with a custom icon (in my case a brand icon of my company), and not use the of the PrimeNG Breadcrumbs component. I though I would be able to manage that with label as HTML but when icon is not set then the fallback HomeIcon is displayed which is not the desirable behaviour. |
Hi, Could you please share a stackblitz example so we can identify the issue clearly? |
Hi, there it is: https://stackblitz.com/edit/angular-tv1w2t?file=src%2Fmain.ts And if you inspect the rendered home element, you will notice that the svg is completely ignored and replaced by a series of white space characters: <span class="p-menuitem-text">
<div class="flex gap-1">
<span>Brand</span>
</div></span> |
This issue has been automatically marked as stale. If this issue is still affecting you with the latest version, please leave any comment, and we will keep it open. We are sorry that we have not been able to prioritize it yet. If you have any new additional information, please include it with your comment! |
I tried with the latest versions of Angular and PrimeNG, and the issue is still present: Angular: 18.2.5 |
Due to PrimeNG team's busy roadmap, this issue is available for anyone to work on. Make sure to reference this issue in your pull request. ✨ Thank you for your contribution! ✨ |
Describe the bug
I want to define an inline SVG icon in a menu item for my breadcrumbs, but the icon is not rendered.
All the other HTML elements are rendered Except the svg.
Environment
Angular 17
Reproducer
No response
Angular version
17.3.0
PrimeNG version
17.12.0
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
20.11.0
Browser(s)
Chrome
Steps to reproduce the behavior
<div class="flex gap-2"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">...</svg> Home</div>
protected items = [];
<p-breadcrumb class="max-w-full" [model]="items" [home]="home" />
Current behaviour:
Only the text is displayed, and the generated HTML is as followed:
Expected behavior
It is expected to display the SVG icon followed by the Home title.
The text was updated successfully, but these errors were encountered: