-
-
Notifications
You must be signed in to change notification settings - Fork 173
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
Autofocus in modal should also focus non-native input elements #6347
Comments
Not sure this is bug or intended but not just for tags field, same for also structure, object, blocks and layout field. |
@mrflix You can specify which field should be automatically focused on the field properties: |
Thanks for the hint, Gerrit. I added |
Of course, this is not the purpose of the autofocus option if it does not work. Let's wait and see what the developers have to say. |
I cannot reproduce this. When I add credits:
type: structure
fields:
role:
type: tags
autofocus: true
name:
type: tags
website:
type: url Without setting an explicit autofocus, dialogs and drawers will attempt to focus the first element from this list of selectors: "[autofocus]",
"[data-autofocus]",
"input",
"textarea",
"select",
"[contenteditable=true]",
"[type=submit]",
"button" Since the tags field/input is rather special, the native |
I can't replicate the bug either.
For me it was a very unintuitive experience that the third field received focus when I added a new line. The fields are sorted in order of importance and I always want to fill in the first field first. |
I think this is not related |
I've rephrased the title. The focus helper used for dialogs and drawers to set the focus on open should also consider other fields/inputs than the native elements listed in https://github.com/getkirby/kirby/blob/main/panel/src/helpers/focus.js#L28-L37 Technically, button is listed in this selector list which the tags list includes. However, since there are native inputs from other fields present in the drawer as well, those will receive preference currently. |
Description
I have a structure with two tags fields at the beginning:
Whenever I add a new entry and the fields slide in from the side, the website field gets focused.
Expected behavior
The first field – the role field – should get focused.
Screenrecording
Screenshot.2024-03-15.at.15.39.56.mp4
Your setup
Kirby Version
4.1.2
The text was updated successfully, but these errors were encountered: