I created a new, clean Blazor WASM project, and added following minimal sample to bottom of index page:
<EditForm Model="FormModel" OnSubmit="OnSubmit">
<InputText @bind-Value="FormModel" />
<button type="submit">Submit</button>
</EditForm>
@code {
public string FormModel { get; set; } = "";
public async Task OnSubmit(EditContext context) => Console.WriteLine("Clicked");
}
When I focus textbox, write something and then click on submit button nothing happens. Only on second click the message appears in console.
This looks like a blazor bug but with many tickets regarding this issue it always turned out to be in fact error in user code. However, none of the solutions or reasons I found apply to this minimal case.
Is there anything I am missing? I would - obviously - like the button to not ignore the first click.