CSS :focus-visible should never happen with mouse click (with rare exceptions)
Steps to reproduce
- Open gtk4-widget-factory.
- Press Tab or press two or more other keys quickly (e.g. J+K, but not J+J).
- Click some focusable widget that has
focus-on-click
enabled (e.g. "togglebutton" in Page 1).
Current behavior
:focus-visible
happens even with mouse click. i.e. Focus rings made by :focus-visible
can be visible even with mouse click, after some keyboard input.
Expected outcome
Like web browsers do, :focus-visible
should never happen with mouse click (but except for text input widgets? Please see the Additional information below). i.e. Focus rings made by :focus-visible
can be visible only with keyboard interaction.
Version information
master
Additional information
Probably text
in entry
and textview
should be the exception here, if feasible.
https://www.w3.org/TR/selectors-4/#the-focus-visible-pseudo says:
Any element which supports keyboard input (such as an
<input>
element, or any other element which may trigger a virtual keyboard to be shown on focus if a physical keyboard is not present) should always match:focus-visible
when focused.