-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Add an API to focus on elements #22892
Copy link
Copy link
Closed
Labels
DoneThis issue has been fixedThis issue has been fixedarea-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 one
Milestone
Metadata
Metadata
Assignees
Labels
DoneThis issue has been fixedThis issue has been fixedarea-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 one
Type
Fields
Give feedbackNo fields configured for issues without a type.
A common ask from Blazor users is the ability to perform trivial DOM operations without having to manually write the JavaScript / JSInterop code. Having the ability to focus on DOM elements is one of the more popular ones that we'd like to address.
To solve this, we'd like to introduce
FocusAsync()as an extension method toElementReftypes. Here's the usage we think would work the best:This would most likely use
JSInteropfor it's implementation, but it would be nice not to have to pass in theIJSRuntimeinstance.Related issue with lots of feedback: #17472