Is your feature request related to a problem? Please describe.
In NET 5 you have added FocusAsync() for ElementReferences. This works fine for all non component html elements. However, I am using EditForm which uses Input components. Unfortunately I am unable to set the focus to these inputs and users of my app have to click on my input first in order to enter information. I really want to set the focus on this components as well to get a better user experience in the app.
Perhaps it might be even possible to add the overwritable methods OnFocus() and OnFocusAsync() to the component itself. What the user can do then is just focus the component and the component itself can manage which control of it should be focused.
For example lets say I have a component called CustomerList.razor. My component contains an input for a search query and a button.
In Index.razor I implement CustomerList and set the Focus to this component which triggers the OnFocus() methods of CustomerList. Within this method I can specify which element of CustomerList should be focused.
Let me know what you think.
Is your feature request related to a problem? Please describe.
In NET 5 you have added
FocusAsync()forElementReferences. This works fine for all non component html elements. However, I am usingEditFormwhich uses Input components. Unfortunately I am unable to set the focus to these inputs and users of my app have to click on my input first in order to enter information. I really want to set the focus on this components as well to get a better user experience in the app.Perhaps it might be even possible to add the overwritable methods
OnFocus()andOnFocusAsync()to the component itself. What the user can do then is just focus the component and the component itself can manage which control of it should be focused.For example lets say I have a component called CustomerList.razor. My component contains an input for a search query and a button.
In Index.razor I implement
CustomerListand set the Focus to this component which triggers theOnFocus()methods ofCustomerList. Within this method I can specify which element ofCustomerListshould be focused.Let me know what you think.