Re: [csswg-drafts] [selectors] :focus-visible matches on initial programmatic focus (#5885)

I updated the [codepen](https://codepen.io/sundress/pen/WNGqobM) to use focusable divs instead of buttons - focusable divs are focused on click in WebKit and Firefox. Now I can see that Firefox shows a focus outline after programmatic focus after a `blur()`, but not if the `blur()` is skipped. (The delay makes no difference in behaviour)

We didn't write the current language into the spec by accident; it was the result of a lot of thought and discussion, for example: https://github.com/WICG/focus-visible/issues/88

A couple of questions to think about:
- Under what circumstances do authors programmatically move focus?
- Why would someone not currently or likely to immediately start using the keyboard want to know what the currently focused element is?



-- 
GitHub Notification of comment by alice
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5885#issuecomment-767137455 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 25 January 2021 21:54:45 UTC