Closed michaelvashchinsky closed 5 years ago
I was able to solve this by calling the leaveAnimateCallback inside the destroyModalElement
function destroyModalElement() {
if ($modal.$isShown && modalElement !== null) {
unbindBackdropEvents();
unbindKeyboardEvents();
}
leaveAnimateCallback()
if (modalScope) {
modalScope.$destroy();
modalScope = null;
}
if (modalElement) {
modalElement.remove();
modalElement = $modal.$element = null;
}
}
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
The
modal
does not remove classesmodal-open modal-with-am-fade
(or similar) frombody
when callingdestroy()
.If you have your
modal
opened and clickback
browser's button to navigate to another route - themodal
just stays open. So I have a service that listens to$scope.$destroy
and callsremove()
on each openedmodal
.remove()
has removal ofbackdropElement
, but not for CSS classes onbody
.I tried to call
hide()
on the modal instance and it has async call toleaveAnimateCallback
inhide()
, but it is not fired (due toscope
being destoryed?).Thank you.