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

Property target dos not working on p-menu #11226

Closed
guillaume-f opened this issue Feb 23, 2022 · 2 comments · Fixed by #11251
Closed

Property target dos not working on p-menu #11226

guillaume-f opened this issue Feb 23, 2022 · 2 comments · Fixed by #11251
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@guillaume-f
Copy link

I'm submitting a ... (check one with "x")

[x ] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Plunkr Case (Bug Reports)
https://stackblitz.com/edit/primeng-menu-demo-pxmvs1?file=src/app/app.component.ts

Current behavior
I want a property target (_blank) on a menu using using p-menu component. The item is corretly showed inside the menu, but the target does not working and, the code is not present inside de dev console

Expected behavior
When the property target is set on a menu item, the target should be work

Minimal reproduction of the problem with instructions
The item named "Router" does not working correctly

Please tell us about your environment:
Windows, Google chrome, Firefox,...

  • Angular version: 12.2.16

  • **PrimeNG version: 12.2.3

    • Browser: all
  • Language: TypeScript 4.3.5

  • Node (for AoT issues): node --version = 14.17.5

@cetincakiroglu cetincakiroglu linked a pull request Mar 1, 2022 that will close this issue
@cetincakiroglu cetincakiroglu self-assigned this Mar 1, 2022
@cetincakiroglu cetincakiroglu added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Mar 2, 2022
@yigitfindikli yigitfindikli added this to the 13.3.0 milestone Mar 9, 2022
yigitfindikli added a commit that referenced this issue Mar 9, 2022
Fixed #11226 - Menu | Property target dos not working
@jayee
Copy link

jayee commented Apr 28, 2022

This problem is not solved correctly.
When using url with no target the page should open with _self (default).
See example "Angular" on https://www.primefaces.org/primeng/menu

Generated source:
<a role="menuitem" class="p-menuitem-link ng-star-inserted" target="undefined" href="http://angular.io" tabindex="0"><span class="p-menuitem-icon pi pi-external-link ng-star-inserted"></span><!----><span class="p-menuitem-text ng-star-inserted">Angular</span><!----><!----></a>

@Xample
Copy link

Xample commented Nov 22, 2022

Hi, I agree there is a real problem, when passing the url into the MenuItem, the target argument is added to the <a> tag…. A possible workaround is either to set the property target to an empty string '' or not to use the url and rely on the routerLink property

[edit]: in anyway, using the url seems to reload the whole page instead of navigating using the internal router.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants