accessible-modal-dialog icon indicating copy to clipboard operation
accessible-modal-dialog copied to clipboard

Memory leak in Dialog.open()

Open sunnywalker opened this issue 6 years ago • 0 comments

https://github.com/ireade/accessible-modal-dialog/blob/b5746cbb7cd86639f3344d7cf62de8983cc331b8/Dialog.js#L26

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.

sunnywalker avatar Dec 20 '18 01:12 sunnywalker