You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Szenario:
you have 2 scrollable lists with items inside.
there is one menu with [popup]="true"
clicking on an item will trigger menu.show() and it will show some menu entries.
Steps that lead to the faulty behaviour:
click on an item of the first scrollable list
menu appears
scroll on the first list
menu disappears
click on an item of the second scrollable list
menu appears
scroll on the second list
!!!!!!!!!!! menu does not disappear !!!!!!!!!!
scroll on the first list
????? menu disapperas ?????
The reason is that the scrollHandler still has the reference to the list item of the first list.
This is bad for two reasons:
It holds a reference to a potentially already deleted element (the first target)
menu will never disappear on scrolling of the second list anymore because bindScrollListener wants to bind to the scroll parents of the first element (which is on the first list)
The solution is to remove the scrollHandler member of Menu on unbindScrollListener
--> no more potential leaking of deleted elements
--> works now with differenet targets from different scrollareas passed to show();
Describe the bug
Szenario:
you have 2 scrollable lists with items inside.
there is one menu with [popup]="true"
clicking on an item will trigger menu.show() and it will show some menu entries.
Steps that lead to the faulty behaviour:
The reason is that the scrollHandler still has the reference to the list item of the first list.
This is bad for two reasons:
It holds a reference to a potentially already deleted element (the first target)
menu will never disappear on scrolling of the second list anymore because bindScrollListener wants to bind to the scroll parents of the first element (which is on the first list)
The solution is to remove the scrollHandler member of Menu on unbindScrollListener
--> no more potential leaking of deleted elements
--> works now with differenet targets from different scrollareas passed to show();
Pull Request Link
#17640
Reason for not contributing a PR
Other Reason
No response
Reproducer
https://stackblitz.com/edit/github-wjmgbgjh?file=src%2Fapp%2Fapp.component.html,src%2Fapp%2Fapp.component.ts,src%2Fapp%2Fapp.component.css,src%2Fapp%2Fapp.component.ts
Environment
Windows
Angular version
Angular 18
PrimeNG version
v18 (LTS Only)
Node version
No response
Browser(s)
No response
Steps to reproduce the behavior
Expected behavior
Scroll should always hide the menu in popup mode
The text was updated successfully, but these errors were encountered: