-
Notifications
You must be signed in to change notification settings - Fork 903
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
deregisterBodyClickListener not working - possible fix #1920
Comments
This looks like a bug in the menu surface class itself: https://github.com/material-components/material-components-web-components/blob/master/packages/menu/mwc-menu-surface-base.ts#L341 |
thanks for looking into this - my current "hack" is to do this (in lit-element updated):
it's ugly - but seems to work. |
@dfreedm - just out of curiosity - may I ask why these types of memory leak issues are considered "Severity: Low"? As I see it there are a couple of them in the "framework" and when using any of the components (menu and tab bar seems rather widespread) in a SPA the events are adding up and up and up.... when building a solid SPA where users might work for hours - it seems to slow down and refiring etc....? |
I see it's been fixed in MDC, when is the next release with this fix expected? It's not just a memory leak, by the way, it messes up the logic when you subscribe to the 'closed' event of the menu surface--each undelegated handler emits an event resulting in an avalanche of events increasing the more times you open the menu. |
@zandaqo You can use the |
The version 0.20.0 fixes this for me, but only when |
Obsolete with M3 |
activating - deactivating the menu's keeps registrering the click event listener on MDCMenuSurface.
Possible fix:
menu-surface component
component.js
FYI - I will post this suggestion on the material-components/material-components-web too
The text was updated successfully, but these errors were encountered: