-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide a way for Nimble Blazor components to request focus #2446
Comments
When a dialog opens the first focusable control inside the dialog should gain focus. Can see it via the cursor in this example: https://jsbin.com/sixetez/3/edit?html,output My question is are you seeing the first focusable control gain focus or does the blazor integration / windowing change the behavior? If the first focusable control is immediately focused as expected, is there some other behavior being requested? |
I am not seeing the first focusable control immediately focused. I suspect this is because the dialog content is being populated dynamically, and is not yet there at the initial dialog render. |
Are you able to delay the call to ShowAsync until after the dialog contents are populated? |
Regarding the I suspect that we likely should ultimately expose access to the |
Chatted with Meyers offline and a couple points:
|
🙋 Feature Request
😯 Problem to Solve
There is an ask that on opening a
NimbleDialog
, we give focus to a particular Nimble field control within the dialog. I don't think this is possible with Nimble Blazor fields at the moment without resorting to some hacky JS that understands the internal implementation of the control.💁 Proposed Solution
Some Nimble Blazor components - at least fields - expose a
FocusAsync
method. The internal implementation would need to find theElementReference
for the focusable part of the control and call the .NETFocusAsync
method on it.Exposing the
ElementReference
itself (or a wrapped version of it) could also be an option. We do have some bUnit test code that finds the input element for a field and invokes events likeChange
on it.📋 Tasks
The text was updated successfully, but these errors were encountered: