Open shadow-identity opened 1 year ago
It may not be necessary in many cases; as the spec states:
The dialog focusing steps attempt to pick a good candidate for initial focus when a dialog is shown
It looks like browsers will already focus the first interactive element and if there is none, the dialog itself. So you should only need it...
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-elementReproduction
https://svelte.dev/repl/483135a2842e4da6ba6f24ea63430cf2?version=4.2.0
Logs
No response
System Info
Severity
annoyance