Skip to main content

DxTagBox<TData, TValue>.FocusAsync() Method

Moves focus to the TagBox component.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v23.2.dll

NuGet Package: DevExpress.Blazor

Declaration

public ValueTask FocusAsync()

Returns

Type Description
ValueTask

A structure that stores an awaitable result of an asynchronous operation.

Remarks

Call this method to move focus to the input element of the TagBox component as the following code snippet demonstrates. In this example focus moves to the element after the first render.

<DxTagBox @ref="component" Data="@Cities" @bind-Values="@Values"></DxTagBox>

@code {
    DxTagBox<string, string> component;

    /* ... */

    protected override void OnAfterRender(bool firstRender)
    {
        base.OnAfterRender(firstRender);
        component.FocusAsync();
    }
}

Focused Element

See Also