-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Wrong a11y wargning on <dialog> with autofocus attribute #9225
Comments
It may not be necessary in many cases; as the spec states:
It looks like browsers will already focus the first interactive element and if there is none, the dialog itself.
I guess a common case would be a close button you want to skip, though. |
Agree that using this attribute could be not necessary, but still recommended and definitely not an error, so should not be treated as an a11y issue. |
Describe the bug
Ally warning "Avoid using autofocus" appears on
<dialog autofocus>
element definition.But using of autofocus on dialog or its descendants is recommended by the standard: https://html.spec.whatwg.org/multipage/interactive-elements.html#the-dialog-element
Reproduction
https://svelte.dev/repl/483135a2842e4da6ba6f24ea63430cf2?version=4.2.0
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: