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

Dynamic contextmenu items cause null exception in ContextMenu.positionSubmenu #11173

Closed
greg9504 opened this issue Feb 10, 2022 · 1 comment
Closed
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@greg9504
Copy link

greg9504 commented Feb 10, 2022

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)
Please demonstrate your case at stackblitz by using the issue template below. Issues without a test case have much less possibility to be reviewd in detail and assisted.

Here is stackblitz with 13 and failing:
https://stackblitz.com/edit/angular-ivy-fa7of2?file=src/app/app.component.html

Here is stackblitz with 10 and working (please ignore url naming):
https://stackblitz.com/edit/angular-10-directive-elementref-example-ws5lg4?file=src/app/app.component.ts

Current behavior

Dynamically add items to bound MenuItem[] then use ContextMenu.show(). First time you are able to select the dynamically added menu item. The dynamically added item is removed in the onHide() event. The second time you right click the dynamic item is added again but a null exception occurs. This was working fine with Primeng 9 and 10. When updating to 11 the bug was introduced, and exists in 13.

Expected behavior

Not throw null reference exception.

Minimal reproduction of the problem with instructions

See above.

Please tell us about your environment:

Windows 10

  • Angular version: 5.X

Bug first appears with Angular 11, but present in 12 and 13.

  • PrimeNG version: 5.X

Bug first appeared with Primeng 11, present in 12 and 13.

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]

Only tested with Chrome Version 98.0.4758.82 on Windows

  • Language: [all | TypeScript X.X | ES6/7 | ES5]

  • Node (for AoT issues): node --version =
    With or without IVY.

@yigitfindikli yigitfindikli added this to the 13.1.2 milestone Feb 11, 2022
@yigitfindikli yigitfindikli added Status: Pending Review Issue or pull request is being reviewed by Core Team Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Pending Review Issue or pull request is being reviewed by Core Team labels Feb 11, 2022
@yigitfindikli yigitfindikli self-assigned this Feb 11, 2022
@greg9504
Copy link
Author

greg9504 commented Feb 11, 2022

thank you for looking at this.

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

No branches or pull requests

3 participants