Does auto focus assign poor to accessibility?

If I have a form that is the main part of the content of the page, does assigning focus to the first field of the form via JavaScript when loading the page have any negative consequences for accessibility?

+6
javascript accessibility dhtml
source share
6 answers

Short answer: no, it does not make things inaccessible, but it can be confusing. The following is a longer answer. Do your users know that there will be a page with the form, and should there be any descriptive text that you should read before filling out the form? I'm a screen user, and it can be annoying if you focus on random fields. Itโ€™s clear why your focus ends in the Google search box, so this doesnโ€™t bother me. If my focus was automatically placed in the answer edit box every time I considered the Stackoverflow question, I would be annoyed, as I would have to make the screen device move from the form field to the top of the page.

+10
source share

This may be a bit if we have a keyboard user (either using a screen reader or just a regular keyboard user) who expects to follow the links at the top of the page the first time Tab is pressed. For screen readers, you might also consider adding WAI-ARIA to add routes if users who do not expect to be dropped in the middle of the form.

If it is much more likely that the user wants to immediately enter text in the field, I think that autofocus is worth it. But for the reason above, I would not use it on every page with an input field.

If you are performing autofocus, be sure to do it immediately, in the script, as soon as possible after the input element or in the future using the HTML5 autofocus attribute. Do not do this until window.onload . This is annoying when you click the focus elsewhere, only for the document to finish loading late and steal the focus on another item as you type.

+2
source share

will set focus for the first form field via javascript on page loading, have any negative effects on accessibility?

I canโ€™t think of anything. Between the fields, irritation of any auxiliary software that the user can work with may occur, but the first field is unlikely. I have no experience with braille and similar clients.

Seeing that even Google is doing this on its first page, I donโ€™t think it could be such a big deal anyway.

0
source share

I would not say so, fragments are a component of HTTP, and they set focus on the * html page.

0
source share

Many sites will do this, google is a good example, the only problem is when you type something in the address bar or in the search input in your browser, the focus action of the form field tends to steal focus from where you are typing. This is a little nuisance.

0
source share

I would not say that. The screensaver will probably not even notice this, because it does not interpret JavaScript on the page.

Another user with a โ€œnormalโ€ browser will have the advantage that the cursor is already in the right place, which facilitates navigation using only the keyboard.

-3
source share

All Articles