ElementReferenceExtensions.FocusAsync 方法

定义

重载

FocusAsync(ElementReference)

为给定 ElementReference元素的 元素提供焦点。

FocusAsync(ElementReference, Boolean)

为给定 ElementReference元素的 元素提供焦点。

FocusAsync(ElementReference)

为给定 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

参数

elementReference
ElementReference

对要聚焦的元素的引用。

返回

表示 ValueTask 异步焦点操作的 。

适用于

FocusAsync(ElementReference, Boolean)

为给定 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

参数

elementReference
ElementReference

对要聚焦的元素的引用。

preventScroll
Boolean

一个 Boolean 值,该值指示浏览器是否应滚动文档以将新聚焦的元素引入视图。 preventScroll 的值为 false, (默认) 意味着浏览器在聚焦后会将元素滚动到视图中。 如果 preventScroll 设置为 true,则不会滚动。

返回

表示 ValueTask 异步焦点操作的 。

适用于