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

Is it possible to disable the auto focus on first element? #108

Open
acespace90 opened this issue Feb 15, 2018 · 7 comments
Open

Is it possible to disable the auto focus on first element? #108

acespace90 opened this issue Feb 15, 2018 · 7 comments
Labels

Comments

@acespace90
Copy link

acespace90 commented Feb 15, 2018

Is it possible to disable the auto focus on first element? It would be nice if there was an option.

Thanks

@adamduncan
Copy link
Contributor

Hey @acespace90, thanks for the question. Which component(s) are you referring to?

In order to be properly accessible, it's often recommended that focus is shifted to the newly activated element or a child. See Modal WAI focus guidelines, for example.

If you can let me know the behaviour you're hoping for (or what you're trying to avoid), we can try to suggest some approaches.

@acespace90
Copy link
Author

Hi @adamduncan, I refer to the dialog component. I noticed that if I have a select as the first element of the modal, followed by some text, the screen reader does not interact properly with the select and continues with the reading of the text. But if I manually force the tab on select, then the screen reader reads it correctly. I hope I explained myself.

schermata 2018-02-16 alle 09 51 06

@adamduncan
Copy link
Contributor

Interesting. What screenreader/browser combo are you using?

What elements are being used for the custom select menu? I wonder whether it might be related to that. The modal will automatically look for these focusable child elements. (The Authoring Practices modal example does a similar thing, but in a more programmatic way.)

If the select is a native select element (or has a non-negative tabindex) and it precedes any other focusable elements in the modal, then it should receive focus correctly.

@acespace90
Copy link
Author

I’m using Chrome on Mac with system screen reader. The select is 100% native and has no negative tabindex, only the external container is styled.

@adamduncan
Copy link
Contributor

Ah, right. That's great then.

Voiceover announces the modal title and dictates all modal content before announcing the focused element. Here's an example - after the content, Voiceover will announce Option 1, Make a selection, collapsed, popup button, and finally context, You are currently on a pop up button, inside of a frame.... Are you experiencing the same with yours?

@acespace90
Copy link
Author

Mmmh, no because it reads the text after the select. It should stop when is on the select and not continue to read text? No?

@ZoeBijl
Copy link

ZoeBijl commented Feb 20, 2018

@acespace90 can you provide a code example? That way we can test exactly what happens. Also note that VoiceOver doesn’t support Chrome; it may work in certain cases, but it’s not supported from within Apple.

As for the focusables, the close button should be first in that order. Alternatively you can set focus on the dialog itself.

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

No branches or pull requests

3 participants