Sparked by this issue, it would be useful to have an overlayDestroy property for modals. This new property would act similar to overlayClose, except that it would also destroy the modal after closing it. This way the modal is completely removed from the DOM when the overlay is clicked. As shown in the issue above, there is a memory leak if you attempt to use overlayClose without providing an ID. Using overlayDestroy in that case would solve the issue.
Sparked by this issue, it would be useful to have an
overlayDestroyproperty for modals. This new property would act similar tooverlayClose, except that it would also destroy the modal after closing it. This way the modal is completely removed from the DOM when the overlay is clicked. As shown in the issue above, there is a memory leak if you attempt to useoverlayClosewithout providing an ID. UsingoverlayDestroyin that case would solve the issue.