Open Bug 1742284 Opened 3 years ago Updated 11 months ago

Feature request: offer a user setting to always show keyboard focus (override :focus-visible heuristic)

Categories

(Core :: DOM: UI Events & Focus Handling, enhancement)

Firefox 94
enhancement

Tracking

()

UNCONFIRMED

People

(Reporter: redux, Unassigned)

Details

Steps to reproduce:

Now that most browsers support :focus-visible https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible and site authors are beginning to use it, it would be a nice accessibility feature to have a setting (in the user-friendly Settings pages) that allows users to explicitly force visible focus in all situations (rather than applying the heuristics currently in use to suppress default focus indication, and thus :focus-visible, when it's a result of mouse or touch.

Actual results:

Currently pressing on a <button> with mouse or touch does not show a default focus indicator by default, and any :focus-visible styles are therefore also not applied. Only if the user sets focus to the <button> via the keyboard are default focus indicators shown, and hence :focus-visible styles are applied.

Expected results:

Some users will want to have visible focus always, regardless of input mechanism used. With an override/setting, we'd be able to have the best of both worlds: tap into the :focus-visible / browser heuristics/logic for not showing focus indications as a result of mouse/touch, but give the option for users who want it to always have it.

This applies to Firefox both on desktop and phone/tablet.

FWIW filed a matching request for Chromium here https://bugs.chromium.org/p/chromium/issues/detail?id=1272296

The Bugbug bot thinks this bug should belong to the 'Core::DOM: UI Events & Focus Handling' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → DOM: UI Events & Focus Handling
Product: Firefox → Core

The shorter version of this ask is: have a preference, easily visible/accessible from the main Preferences, that toggles the browser.display.show_focus_rings boolean.

Setting this to true forces focus ring to appear, even after a mouse click, meaning that :focus-visible styles then apply even as a result of a mouse (or other pointer) interaction.

Related:

https://bugzilla.mozilla.org/show_bug.cgi?id=1445482 (original bug about implementing :focus-visible in Firefox, and specifically https://bugzilla.mozilla.org/show_bug.cgi?id=1445482#c21 about changing the original behaviour of showing focus ring even after mouse interactions IF the user has interacted with the page using the keyboard at least once)

https://bugzilla.mozilla.org/show_bug.cgi?id=1677376 (which mentions the prefs, but falls short of actually adding a user-exposed preference - other than diving into about:config)

You need to log in before you can comment on or make changes to this bug.