Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am curious if there is a way to get the modal form to capture the focus of the cursor. For instance, the login modal form should have the cursor in the username field by default. Is this easily done?
Comment | File | Size | Author |
---|---|---|---|
#4 | modal_forms-login_form_autofocus-1440336-7303870.patch | 511 bytes | selfsimilar |
Comments
Comment #1
scor CreditAttribution: scor commentedyes, that would make a lot of sense. +1
Comment #2
selfsimilar CreditAttribution: selfsimilar commentedif you don't mind editing the module itself, you can add this behavior easily.
edit the file js/modal_forms_login.js:
Comment #3
scor CreditAttribution: scor commented@selfsimilar would you like to roll a patch? It seems like a good feature which should be part of this module.
Comment #4
selfsimilar CreditAttribution: selfsimilar commentedI'm happy to roll a patch for this. I just don't know if the patch would get rolled into the main branch. This was a quick little hack and if the main developer wanted this to be an optional change someone would have to add to the admin menu to etc.
That said, here's the patch.