Breadcrumb link opens in new tab

UI Components for Angular
Post Reply
koen.koninckx
Posts: 2
Joined: 29 Jul 2022, 10:52

30 Nov 2022, 18:18

Links of the breadcrumb component are opening in a new tab. When I inspect the hrml, I notice the target is undefined. If I chnage it to _self in develioper tools, it opens in the same tab.

<li ptooltip="" class="p-element ng-star-inserted" ng-reflect-text="" ng-reflect-ng-class="[object Object]">
<a class="p-menuitem-link ng-star-inserted" target="undefined" href="/activity/67740003/dossier" tabindex="0">
<span class="p-menuitem-text ng-star-inserted">Onderschrijving</span>
</a>
</li>

When I test the same in stackblitz (prime ng 13.0.4) It works fine, but the html looks lsightly different
https://stackblitz.com/edit/primeng-bre ... .module.ts

No target is present on the a tag
ptooltip is also on the a tag, whereas the tooltip is on li in my setup

<li ng-reflect-ng-class="[object Object]">
<a ptooltip="" class="p-element p-menuitem-link" ng-reflect-text="" href="http://google.com" tabindex="0"><span class="p-menuitem-text">Item</span>
</a>
</li>

We are using Angular version 14 with prime version 14.2.2


Thanks for your help

mahesheu
Posts: 1
Joined: 05 Jan 2023, 08:54

05 Jan 2023, 08:58

I am also having the same issue with primeng 13.4.1.. This was working fine before in angular 11 and old version of primeng.. when upgraded angular & primeng to 13 , this issue started to happen..Does anyone have a solution for this ?

naripi
Posts: 1
Joined: 09 Jan 2023, 05:33

09 Jan 2023, 05:37

Thank you! Breadcrumb is good
What is the solution for new updates? weaver game

chrizzlee
Posts: 1
Joined: 26 Jan 2023, 14:57

26 Jan 2023, 15:06

Items that are displayed by the breadcrumb are of the type MenuItem[] -> https://www.primefaces.org/primeng/breadcrumb

Simply add the target property to your items that are passed, for example:

this.breadcrumbItems: MenuItem[] = [
{ label: 'Label', url: '<your url>', target: '_self' }
];

This works for me,

best regards.

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 10 guests