W3C home > Mailing lists > Public > public-css-archive@w3.org > October 2019

Re: [csswg-drafts] [css-ui] outline is not visible when moving focus programmatically (#4421)

From: Amelia Bellamy-Royds via GitHub <sysbot+gh@w3.org>
Date: Tue, 15 Oct 2019 20:42:55 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-542395971-1571172174-sysbot+gh@w3.org>
Ah, looks like CSS _does_ define this, as ["non-normative suggestions"](https://drafts.csswg.org/selectors-4/#focus-visible-pseudo):

> - If the active element matches :focus-visible, and a script causes focus to move elsewhere, the newly focused element should match :focus-visible.
> 
> - Conversely, if the active element does not match :focus-visible, and a script causes focus to move elsewhere, the newly focused element should not match :focus-visible.

It's that last point that is problematic. Example case: I click on a custom select box to focus it, then use the arrows to cycle through the options. The original focus of the box may not have required a focus ring, but the keyboard actions do need one.

I would therefore recommend removing that last bullet point from CSS UI, and beyond that I'd hope browsers would add some heuristics for identifying which user interaction caused the change in focus (as Alice mentions [on the HTML issue](https://github.com/whatwg/html/issues/5004#issuecomment-541976527)).

-- 
GitHub Notification of comment by AmeliaBR
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4421#issuecomment-542395971 using your GitHub account
Received on Tuesday, 15 October 2019 20:42:58 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:54 UTC