diff --git a/src/Blazored.Modal/BlazoredModalInstance.razor.cs b/src/Blazored.Modal/BlazoredModalInstance.razor.cs index bca1b08..c81a671 100644 --- a/src/Blazored.Modal/BlazoredModalInstance.razor.cs +++ b/src/Blazored.Modal/BlazoredModalInstance.razor.cs @@ -95,14 +95,14 @@ public async Task CloseAsync() public async Task CloseAsync(ModalResult modalResult) { // Fade out the modal, and after that actually remove it - if (AnimationType is ModalAnimationType.FadeInOut) + if (AnimationType is ModalAnimationType.FadeInOut && !UseCustomLayout) { OverlayAnimationClass += " fade-out"; StateHasChanged(); await Task.Delay(400); // Needs to be a bit more than the animation time because of delays in the animation being applied between server and client (at least when using blazor server side), I think. } - else if (AnimationType is ModalAnimationType.PopInOut) + else if (AnimationType is ModalAnimationType.PopInOut && !UseCustomLayout) { OverlayAnimationClass += " pop-out"; StateHasChanged();