Skip to main content

DxMemo.FocusAsync() Method

Moves focus to the Memo component.

Namespace: DevExpress.Blazor

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

<DxMemo @ref="component" Text="This is Memo. It is a multiline text editor."></DxMemo>

@code {
    DxMemo component;

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

Focused Element

See Also