focus-visible icon indicating copy to clipboard operation
focus-visible copied to clipboard

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

Open craigkovatch opened this issue 2 years ago • 3 comments

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 avatar Apr 13 '22 21:04 craigkovatch

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

craigkovatch avatar Apr 13 '22 21:04 craigkovatch

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 https://github.com/whatwg/html/issues/7830

mrego avatar Apr 18 '22 07:04 mrego

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.

craigkovatch avatar Apr 19 '22 21:04 craigkovatch