-
Notifications
You must be signed in to change notification settings - Fork 10.7k
InputText component should provide a FocusAsync() method #24446
Copy link
Copy link
Closed
Labels
affected-fewThis issue impacts only small number of customersThis issue impacts only small number of customersarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing onehelp wantedUp for grabs. We would accept a PR to help resolve this issueUp for grabs. We would accept a PR to help resolve this issueseverity-majorThis label is used by an internal toolThis label is used by an internal tool
Milestone
Metadata
Metadata
Assignees
Labels
affected-fewThis issue impacts only small number of customersThis issue impacts only small number of customersarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing onehelp wantedUp for grabs. We would accept a PR to help resolve this issueUp for grabs. We would accept a PR to help resolve this issueseverity-majorThis label is used by an internal toolThis label is used by an internal tool
Type
Fields
Give feedbackNo fields configured for issues without a type.
The PR #23316 introduced
ElementReference.FocusAsync()which is convenient to focus an html element.In my case I need to focus an
<InputText>component in a form. There are 2 cases where I want to focus the element:I currently use a custom component that inherits from InputText and provide a FocusAsync method.
In the parent component I can use FocusAsync when needed which works well.
I think
InputBase<T>or each component should have aFocusAsyncmethod, so I don't need to override components:namespace Microsoft.AspNetCore.Components.Forms { public class InputBase<T> { + public ValueTask FocusAsync(); } }