Skip to content

Blazored modal causes the parent component to refresh #428

Answered by yunusozan
yunusozan asked this question in Q&A
Discussion options

You must be logged in to vote

Blazored modal causes the parent component to refresh when i closed or canceled it. this problem occurs only when i use select input an bind it in blazored modal.

<select id="inputState" class="form-select" @bind="StockGUI.Unit.ID" required>
		@foreach (var item in Units)
		{
		      <option value="@item.ID">@item.Description</option>
		}
</select>

ModalInstance.CancelAsync();

and then this method in parent component will calling by itself.

protected override async Task OnInitializedAsync()

i lose all the data i keep inside properties of parent component.

is there any solution?

The problem is caused by submitting form. it solved when i was replace form with div. you can remove this que…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by yunusozan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant