Closed kevingates closed 5 years ago
Thank you for filing this issue. In order for us to investigate this issue, please provide a minimalistic repro project (ideally a GitHub repo) that illustrates the problem.
Hi. We're closing this issue as we have heard no response from you for some time now. If you have more details and are encountering this issue please add a new reply and re-open the issue.
@mkArtakMSFT Here's a repo: https://github.com/kevingates/Blazor_EditForm
@kevingates I haven't dug in to this super well, but it looks like a bug in your code. ShowModal
is set when you submit -
https://github.com/kevingates/Blazor_EditForm/blob/master/EditFormBug/EditFormBug/Pages/Index.razor - but nothing resets it. Once you've submitted the form, any time the Index
component is rendered, the modal is still meant to be displayed. I'd have a look at how the modal component is built in the BlazingPizza sample - https://github.com/danroth27/BlazingPizza/ if you need to figure out a pattern for this.
@kevingates I haven't dug in to this super well, but it looks like a bug in your code.
ShowModal
is set when you submit - https://github.com/kevingates/Blazor_EditForm/blob/master/EditFormBug/EditFormBug/Pages/Index.razor - but nothing resets it. Once you've submitted the form, any time theIndex
component is rendered, the modal is still meant to be displayed. I'd have a look at how the modal component is built in the BlazingPizza sample - https://github.com/danroth27/BlazingPizza/ if you need to figure out a pattern for this.
@pranavkm You are absolutely correct. I have the modal closing itself within the modal's code, but since the parent is only having its state updated (versus being reinitialized) you're right that I am have it re-shown. I have my callback function change my "modalSettings" to false after I hear back and it fixed the issue.
First, I apologize for posting a bug about my own mistake.
Second, I sincerely appreciate your help in pointing this out and for the Blazing Pizza example. I was looking for his code recently. I will bookmark this and maybe adopt his modal instead.
I will go ahead and close this issue.
Many thanks.
Describe the bug
A clear and concise description of what the bug is. When using the EditForm component, after the initial submission, if you tab through the fields again, every "Tab" action attempts a resubmission.
To Reproduce
Steps to reproduce the behavior:
For me, my Modal popup runs. This is caused only by the EditForm's
OnValidSubmit
attribute running my Submit function.Expected behavior
A clear and concise description of what you expected to happen. Tabbing through input fields should never submit a form.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here. Include the output of
dotnet --info
dotnet --info results
I haven't tested this fully yet, but I think this was also occurring with just a plain html
<form>
tag used within Blazor Components. I had an issue a few weeks ago, and this may have been a related issue.