Updated dialog initial focus algorithm
- Category
- DOM
- Type
- No developer-visible change
- Status
- Enabled by default (Chrome Enabled by default)
- Intent stage
- Prepare to ship
WPT details: https://github.com/web-platform-tests/wpt/pull/36831
Summary
Some changes are being made to which element is selected to get focus when a dialog element is opened: 1. Make the dialog focusing steps look at keyboard focusable elements instead of any focusable element. 2. Make the dialog element itself get focus if it has the autofocus attribute set. 3. Make the dialog element itself get focus as a fallback instead of focus being "reset" to the body element.
Standards & signals
- Specification: https://github.com/whatwg/html/pull/8199
- Firefox: Positive
- Safari: Support
- Web developers: No signals
- Tracking bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1193482
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=updated-dialog-initial-focus-algorithm
- Chrome Platform Showcase: https://chrome-platform-showcase.paulkinlan-ea.deno.net/features
- GenDN reference: https://gendn.paulkinlan-ea.deno.net/features
- chrome.dev demos search: https://www.google.com/search?q=site%3Achrome.dev+Updated%20dialog%20initial%20focus%20algorithm
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=Updated%20dialog%20initial%20focus%20algorithm
- Baseline status: https://webstatus.dev/?q=Updated%20dialog%20initial%20focus%20algorithm