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
[UX] Give focus to top field when creating content #2625
Comments
@laryn good idea! There is quite a bit of opinion about this in the Drupal queues: https://www.drupal.org/node/1538022 Not the least of which is surrounding accessibility issues. For screen readers the autofocus will cause it to skip to that part of the markup missing content that is above the autofocused element (perhaps form instructions) In any event you should be able to take this patch and adapt it to either Let's see what others have to say about the accessibility issues, other problems or suggestions. ~Geoff |
That was quick! Would it be better for accessibility if this were targeted just on the admin pages like the create node/term/layout pages, which don't really have any preamble? Site visitors wouldn't then automatically get the first field focused on front-facing site forms. |
There's a contrib module in D7 for that already, that we could port if we decide not to include the feature in Backdrop core after all: https://www.drupal.org/project/focus ...and from that project's page, there was a link to this core issue: https://www.drupal.org/node/90324 that has been filed back 2006 and was eventually wontfixed. Turns out that this is a usability+ but an accessibility-. Seems we can't have both in this case 😞 |
Things may have changed a bit since both that project and issue were filed. In HTML5, there is now a simple attribute for Automatically making the first field autofocus in every form seems heavy handed. Especially as we can't even determine if the first field is really that important (e.g. on any settings form that may have lots of options). Imagine doing that on the I think we could make a very tiny step in the right direction by using At the very bottom of the Drupal issue, @Bojhan makes the exact same case (I found after I just typed this):
|
Filed a new PR backdrop/backdrop#1832 to add the @quicksketch back to NR. |
@serundeputy as per the original issue, I agree the Add Term form needs this the most. Can we do it there too? |
@docwilmot absolutely we can.
|
😏 |
I'll put it in for the add term forms too. Hopefully tomorrow. |
Updated PR https://github.com/backdrop/backdrop/pull/1832/files to add autofocus to taxonomy term add title as well. |
RTBC! |
Thanks @laryn, @docwilmot and @quicksketch this is merged into |
I think it would be good to automatically give focus to the top field when creating content (nodes, terms, etc.).
I noticed it today when I had to input 10-20 terms in a vocabulary and had to click into title each time before I could type the term. If focus happened automatically it would be simple to type, press enter, pause and then repeat without having to take my hands off the keyboard.
PR: backdrop/backdrop#1826closed in favor of no js solt'nPR: backdrop/backdrop#1832
The text was updated successfully, but these errors were encountered: