2

How can I add a delay to an event (OnInput) in Blazor ? For example, if a user is typing in the text field and you want to wait until the user has finished typing

Code:

<p>Filter value: @filterQuery</p>
    <input  value="@filterQuery"@oninput="TextChanged"/>
    public async void TextChanged(ChangeEventArgs changeEventArgs)
    {

        string searchText = changeEventArgs.Value.ToString();
        filterQuery = searchText;
{Do stuff....}

    }

To be clear I want the [do stuff] portion to be executed not everytime the user types something, but lets say after a second delay where there are no longer typing events

0 Answers0