I havea blazor app in which a button event is triggered when pressed. The problem is that the event is fired 3 times each time you press the button. I just noticed that if I press Enter instead of clicking the button the event fires just once. (And I don't really know why...)
This is the button and some more html if needed:
<div class="form-container uk-flex uk-flex-column uk-flex-middle">
<span class="input-container">
<input type="text" name="verb" id="form_verb" @bind="searchInput" />
</span>
<!-- This is the button -->
<button type="button" class="uk-button uk-button-secondary" style="width:40%; margin-top:0.25rem;" @onclick="@Search">Lorem ipsum</button>
</div>
<h1>@counter</h1>
And this is the event that is fired:
private async Task Search()
{
counter = counter + 1;
navigatableSearchInput = searchInput;
await tablaReconocimientos.SearchVerb(searchInput);
}
Here you have an example of whats going on:

EDIT_1: changed @onclick event with @onclick="@Search". Same behaviour.
EDIT_2: pressing enter behaviour added.
EDIT_3: markup for button clarification
@onclick="@Search"and update your question with the result? - Nik P