Skip to content
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

[typo] focus should not necessarily be set to the **_first_** interactive element in the dialog #2241

Open
philljenkins opened this issue Mar 1, 2022 · 9 comments

Comments

@philljenkins
Copy link

Regarding example in Understanding Success Criterion 2.4.3: Focus Order
https://w3c.github.io/wcag21/understanding/focus-order.html

Some auditors and developers are interpreting example no. 3 as a "requirement", that literally the "fist" interactive element should always receive focus first. That is not the intent of the SC and confuses the reader, since many times it is more desirable for the focus to be set on the primary interactive element. For example, on a log-in screen it would not be desirable for the focus to be set on a "cancel X button" that might appear at the top right of a dialog or page that redundantly includes a "Cancel" button at the bottom of the dialog or page when the primary purpose of the dialog is to enter some input such as a name, ID, or some other primary input.

  1. A Web page implements modal dialogs via scripting. When the trigger button is activated, a dialog opens and focus is set to the first interactive element in the dialog. As long as the dialog is open, focus is limited ...

Please change "first" to "primary".

@JAWS-test
Copy link

I think it depends on the context whether first or primary is better. That's why I wouldn't be in favor of replacing first with primary. I would like to see an addition: "first or primary". Also, it could be explained when first and when primary makes sense.

Justification: For example, the login pop up may have a drop down list for the application language or other relevant but not primary settings before the username input field. If these intial do not have focus, blind users will have difficulty recognizing that there are other form fields before the username input field.

@patrickhlauke
Copy link
Member

it might not even need to go to an interactive element at all, but to something like the first non-interactive heading in the dialog (for content-heavy dialogs, rather than dialogs that just contain mainly form controls) - see w3c/aria-practices#442

@patrickhlauke
Copy link
Member

though it bears reminding auditors/developers that understanding document is non-normative, and the examples are just that...examples. non-exhaustive, and not necessarily binding.

@alastc
Copy link
Contributor

alastc commented Mar 1, 2022

Indeed, these are examples. We could add a duplicate of that example which said "primary" instead of "first". It isn't prescribing what you have to do, it is an example of something that would pass. (NB: I don't think we should add a duplicate, that would just add text for very little benefit.)

@patrickhlauke
Copy link
Member

patrickhlauke commented Mar 1, 2022

or change the example from suggesting a particular place for focus to land (first interactive? primary? somewhere else?) and just say that focus goes to the modal dialog and leave it as an exercise for the reader to work out what that means (the main thing is that it doesn't remain in the underlying page that triggered the modal, which is the usual problem we find)

or yes, just leave it as is and educate authors/developers some more about what examples are intended to do

@awkawk
Copy link
Member

awkawk commented Mar 1, 2022

It seems that the main point of this example is to move the focus to the dialog and to return it from where it was once the dialog is closed. How about changing from:

When the trigger button is activated, a dialog opens and focus is set to the first interactive element in the dialog

to:
When the trigger button is activated, a dialog opens and focus is set within the dialog.

@patrickhlauke
Copy link
Member

It seems that the main point of this example is to move the focus to the dialog and to return it from where it was once the dialog is closed. How about changing from:

When the trigger button is activated, a dialog opens and focus is set to the first interactive element in the dialog

to: When the trigger button is activated, a dialog opens and focus is set within the dialog.

seems you agree with the comment of mine just before yours ;)

so yes, that'd get my vote too

@awkawk
Copy link
Member

awkawk commented Mar 1, 2022

@patrickhlauke yes, I agree! I wanted to suggest specific language to be specific about what that change would be. :)

@fstrr
Copy link
Contributor

fstrr commented Apr 8, 2022

proposed response:

It isn't a failure of Focus Order if, when a modal dialog is opened, focus isn't set to the first interactive element within the dialog. Focus does need to be set within the dialog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants