Hacker News new | ask | show | jobs
by Eduard 1607 days ago
> One particular thing is that it is generally recommended against auto focusing in fields [...]

What do you mean by "generally recommended"? The publication reviews WCAG 2.0. I don't know any WCAG recommendation that fits your described annoyance. In fact, WCAG 2.1 does recommend to e.g. put focus on the first form element with failing form validation, see https://www.w3.org/WAI/tutorials/forms/notifications/#after-...

More information: https://www.w3.org/WAI/WCAG21/Understanding/on-focus.html

1 comments

actually I was going quite fast when I wrote it, and I wrote auto focus when what I was trying to convey is step 3 of the intent - focus is changed to another component when that component receives focus;

If for example you have an application for finding service errors in an area you might show a form when people first enter the application, search for address, users search and select the address the form goes away and shows results (this right there would be an accessibility error although quite reasonable for a non-disabled user) at the top of results there is a change address button, clicking that brings the search form back into view and sets the focus in the search field.

The loss of context with that operation could be a real problem for a blind user (there are of course lots of forms of visual disability, so I will in this case specify it is blindness that is most seriously bothered by this common functionality that benefits sighted users, but at any rate I have interacted with some applications that did this which navigating blind was an irritant and navigating with sight a benefit)

So what I mean by generally recommended is - don't do things like my scenario above which violate point 3 https://www.w3.org/WAI/WCAG21/Understanding/on-focus.html even though that behavior is a minor benefit for the sighted user with no disability, and in the case of a sighted user with motor disabilities probably a real benefit.

when I say (this right there would be an accessibility error although quite reasonable for a non-disabled user) obviously that means that it would be unless you did something to let people know the form went away and next you will be reading service errors related to the address you searched for