Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implements the proposed spec changes discussed in whatwg/html#1929 to focus the dialog element itself, rather than the first focusable child (unless there is a child with the
autofocus
attribute).A summary of that WHATWG bug is that screenreaders and other assistive technologies give much more useful output when the dialog itself is focus on opening, and the automatic focus led to unexpected results when combined with tabindex.
In our case, this will fix the problems we've had with outlines and backgrounds showing on dialog close buttons due to automatic focusing.
I'm not entirely clear whether this should be merged ahead of the spec solidifying, but it does solve a real bug in our case.