Skip to main content
All docs
V21.1

DxMaskedInput<T>.FocusAsync() Method

Moves focus to the Masked Input component.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v21.1.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 Masked Input component as the following code snippet demonstrates. In this example the focus moves to the element after the first render.

<DxMaskedInput @ref="component" Value="23" Mask="C"></DxMaskedInput>

@code {
    DxMaskedInput<int> component;

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

Focused Element

See Also