Share via


ElementReferenceExtensions.FocusAsync Method

Definition

Overloads

FocusAsync(ElementReference)

Gives focus to an element given its ElementReference.

FocusAsync(ElementReference, Boolean)

Gives focus to an element given its ElementReference.

FocusAsync(ElementReference)

Source:
ElementReferenceExtensions.cs
Source:
ElementReferenceExtensions.cs
Source:
ElementReferenceExtensions.cs
Source:
ElementReferenceExtensions.cs
Source:
ElementReferenceExtensions.cs

Gives focus to an element given its ElementReference.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Threading::Tasks::ValueTask FocusAsync(Microsoft::AspNetCore::Components::ElementReference elementReference);
public static System.Threading.Tasks.ValueTask FocusAsync (this Microsoft.AspNetCore.Components.ElementReference elementReference);
static member FocusAsync : Microsoft.AspNetCore.Components.ElementReference -> System.Threading.Tasks.ValueTask
<Extension()>
Public Function FocusAsync (elementReference As ElementReference) As ValueTask

Parameters

elementReference
ElementReference

A reference to the element to focus.

Returns

The ValueTask representing the asynchronous focus operation.

Applies to

FocusAsync(ElementReference, Boolean)

Source:
ElementReferenceExtensions.cs
Source:
ElementReferenceExtensions.cs
Source:
ElementReferenceExtensions.cs
Source:
ElementReferenceExtensions.cs

Gives focus to an element given its ElementReference.

public static System.Threading.Tasks.ValueTask FocusAsync (this Microsoft.AspNetCore.Components.ElementReference elementReference, bool preventScroll);
static member FocusAsync : Microsoft.AspNetCore.Components.ElementReference * bool -> System.Threading.Tasks.ValueTask
<Extension()>
Public Function FocusAsync (elementReference As ElementReference, preventScroll As Boolean) As ValueTask

Parameters

elementReference
ElementReference

A reference to the element to focus.

preventScroll
Boolean

A Boolean value indicating whether or not the browser should scroll the document to bring the newly-focused element into view. A value of false for preventScroll (the default) means that the browser will scroll the element into view after focusing it. If preventScroll is set to true, no scrolling will occur.

Returns

The ValueTask representing the asynchronous focus operation.

Applies to