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

Memory leak in Dialog.open() #3

Open
sunnywalker opened this issue Dec 20, 2018 · 0 comments
Open

Memory leak in Dialog.open() #3

sunnywalker opened this issue Dec 20, 2018 · 0 comments

Comments

@sunnywalker
Copy link

this.dialogEl.addEventListener('keydown', function(e) {

You've got a memory leak in Dialog.open(). Every time a dialog is opened, a new keypress event handler is added to the dialog and a new click handler to the overlay. If a dialog is opened 100 times, that is 200 event handlers for the browser to process. For a navigation menu, this is unlikely, but for other modal dialog uses, it could potentially become problematic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant