diff --git a/src/BlazorStrap/Shared/Components/Modal/BSModalBase.cs b/src/BlazorStrap/Shared/Components/Modal/BSModalBase.cs index 92e34931..9e434063 100644 --- a/src/BlazorStrap/Shared/Components/Modal/BSModalBase.cs +++ b/src/BlazorStrap/Shared/Components/Modal/BSModalBase.cs @@ -137,7 +137,7 @@ public override bool Shown /// /// Using this will allow you to manually control the modal show/hide state. It ignores all forwarded events and only responds to the Show/Hide methods. /// - [Parameter] public bool IsManual { get; set; } + [Parameter] public bool IsManual { get; set; } #region Render props protected abstract string? LayoutClass { get; } @@ -179,7 +179,8 @@ public override async Task HideAsync() } CanRefresh = true; - ShouldRenderContent = false; + if(!ContentAlwaysRendered) + ShouldRenderContent = false; await InvokeAsync(StateHasChanged); @@ -227,6 +228,7 @@ public override async Task ShowAsync() await InvokeAsync(StateHasChanged); taskSource.SetResult(true); await OnShown.InvokeAsync(this); + }; _eventQue.Enqueue(new EventQue { TaskSource = taskSource, Func = func}); diff --git a/src/BlazorStrap/wwwroot/blazorstrapinterop.js b/src/BlazorStrap/wwwroot/blazorstrapinterop.js index c876020f..e83481bb 100644 --- a/src/BlazorStrap/wwwroot/blazorstrapinterop.js +++ b/src/BlazorStrap/wwwroot/blazorstrapinterop.js @@ -140,8 +140,10 @@ export async function showModal(modal, dotnet) { await openModals.forEach(async openModal => { //if data-bs-manual is true then do not hide the modal if (openModal.getAttribute("data-bs-manual") != "true") { - dotnet.invokeMethodAsync('InvokeEventAsync', "javascript", openModal.getAttribute("data-blazorstrap"), "hide", ""); - openModal.classList.remove("show"); + if (openModal.getAttribute("data-blazorstrap") != model.getAttribute("data-blazorstrap") ) { + dotnet.invokeMethodAsync('InvokeEventAsync', "javascript", openModal.getAttribute("data-blazorstrap"), "hide", ""); + openModal.classList.remove("show"); + } } }); await new Promise(resolve => setTimeout(resolve, 75));