Closed etcircle closed 5 years ago
Thank you for filing this issue. In order for us to investigate this issue, please provide a minimalistic repro project that illustrates the problem.
@2nd4ce I tried this out and couldn't reproduce this using our latest nightlies. Do you have a app you could share that clearly reproduces the issue?
Hi @pranavkm ,
Admittedly, I am relatively new to both ASP and Blazor, so I may have messed up something.
Please find enclosed the version when I had that problem. I changed the buttons since then. When you navigate to "/materials/{id}/change " and then use the "Display" button, it actually performs the "OnValidSubmit" call.
<button @onclick=Close class="btn-md btn-success">Close</button>
<button @onclick=Display class="btn-md btn-primary">Display</button>
button
tags without a type
default to submit
. This explains why you're seeing it submit. Changing it to type="button"
should fix the issue. An anchor tag like you posted in the initial description should work just as well.
Thank you! @pranavkm !
Describe the bug
It feels like the buttons without type="submit" are recognized by the call OnValidSubmit. I am not sure if this is expected behavior, but here is the case.
I have a form with three buttons next to each other:
If I click on the button with "Display", I want the system to redirect me to the read-only page. Right now, it behaves as I saved it.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I would expect that OnValidSubmit only takes the button with type=submit. Surely, there is a work-around to that by using something else that looks like a button.