Skip to content
This repository has been archived by the owner on Jul 30, 2019. It is now read-only.

Focus the dialog instead of the first item #1331

Merged
merged 5 commits into from
Apr 17, 2018

Conversation

patricia-gallardo
Copy link
Contributor

Fix #773

Focus the dialog if there are noe autofocus items available, instead of picking the first focusable item

@chaals
Copy link
Collaborator

chaals commented Apr 4, 2018

Needs to be tested - this is based on the agreement in #773 (and likewise in related whatwg/html#1929) and predecessors from bugzilla

@LJWatson
Copy link
Collaborator

LJWatson commented Apr 16, 2018

Test case from MDN, and support data from CIU

Test: when a <dialog> element is opened and the dialog does not contain a field with autofocus enabled, is keyboard focus placed on the <dialog> element itself?

Chrome desktop/mobile: no
Edge: dialog not supported
Firefox: ? (supported behind a flag)
IE: dialog not supported
Opera Mini: dialog not supported
Safari desktop/mobile: dialog not supported
Samsung Internet: no
UC Browser: ?

@patricia-gallardo
Copy link
Contributor Author

Tested on Linux:
Chromium (Chrome/Vivaldi/Opera) all focus the dropdown
Firefox (after enabling in about:config dom.dialog_element.enabled) does not focus anything
I have not tested in Webkit (no mac) or Edge (no windows)
Both Webkit and Edge have issues open around the dialog element, however the support for the element still seems to be in its early stages.

Copy link
Collaborator

@chaals chaals left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Note that the change is at risk because there is only one implementation at the moment.

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

Successfully merging this pull request may close these issues.

3 participants