Replies: 1 comment 1 reply
-
@joehudd I'll verify and get back to you. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a Blazor server-side app (.net core 7) using Blazor.Bootstrap 1.10.2.
I am opening my modal with a component as such...
var parameters = new Dictionary<string, object>(); parameters.Add("record", record); parameters.Add("onCloseCallback", EventCallback.Factory.Create<MouseEventArgs>(this, CloseModalAsync)); await modal.ShowAsync<EditRecord>(title: title, parameters: parameters);
I have a button in the component for the modal to close the modal. That button refers to the parent page's CloseModalAsync() that reads...
public async Task CloseModalAsync() { await modal.HideAsync(); }
My issue is the modal is only hidden with the component still in there. This interferes with entity tracking. Furthermore, the modal will not re-initialize if I am opening the modal with the same component. Meaning it stay in the state it was closed.
When I click the X button in the modal header to close the modal the component is removed and the modal will initialize every time I open/show it.
Currently, my workaround to make my button behave like the X button is blow.
public async Task CloseModalAsync() { await modal.ShowAsync(); await modal.HideAsync(); }
By removing the component from the ShowAsync it clears the component from the existing modal freeing up the entity and allowing the modal to behave similar to the X button being clicked. It is just not as clean.
So what I am missing....How can I get my close button to behave the same way as the X button?
Beta Was this translation helpful? Give feedback.
All reactions