Skip to content

Commit

Permalink
wait for close animation
Browse files Browse the repository at this point in the history
  • Loading branch information
madsrasmussen committed Nov 27, 2023
1 parent ad35ba2 commit 4ba88fc
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@ export class UmbBackofficeModalContainerElement extends UmbLitElement {
const modalElement = new UmbModalElement();
modalElement.modalContext = modal;

// TODO: We need to change this to the close-end event, when it is added to UUI again.
// This solution solves the memory leak issue where the modal contexts where not removed from the manager when they are closed.
// It breaks the modal animation though, so we need to wait for the close-end so we are sure the animation is done.
modalElement.element?.addEventListener('close', () => this._modalManager?.remove(modal.key));
modalElement.element?.addEventListener('close-end', () => this._modalManager?.remove(modal.key));

this._modalElementMap.set(modal.key, modalElement);
});
Expand Down

0 comments on commit 4ba88fc

Please sign in to comment.