Skip to content
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

:focus-visible should match when focus is programmatically moved to inside a dialog #268

Open
craigkovatch opened this issue Apr 13, 2022 · 3 comments

Comments

@craigkovatch
Copy link

craigkovatch commented Apr 13, 2022

Whether <dialog> or [role="dialog], focus should become visible when it is programmatically moved from outside to inside the dialog. i.e. if a user clicks a button that opens a dialog, and now a button is focused-by-default within the dialog per Dialog, that button should show an indicator regardless of whether the dialog was launched by a mouse or keyboard. (Probably not for touch.)

This seems like a significant usability hole in the current heuristic, which I don't see discussed directly in other issues here.

@craigkovatch
Copy link
Author

Oops, I thought I was posting in the working group issues, I see now that this is the polyfill. Same argument apples tho :D

@mrego
Copy link

mrego commented Apr 18, 2022

I think this could be a kind of duplicate of #88.

I've the feeling that the implemented behavior here is the expected one, at least that it was a conscious decision. But probably is hard/impossible to cover all use cases.

@emilio is suggesting a change to FocusOptions so people can decide when to show it or not when moving the focus via script. See whatwg/html#7830

@craigkovatch
Copy link
Author

I think the FocusOptions suggestion is great. I agree trying to chase these edge cases is a losing game, although I do think there are a few like this one which are succinct enough that we should cover them in the spec.

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

No branches or pull requests

2 participants