A11y: Focus navigation changed in Chromium
Open
@hristop is already working on this.
Since Feb 12, 2025.
enhancement
in progress
- Dominant language
- JavaScript
- Stars
- 3.3k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
Background
Some years ago, I had submitted this issue on Chromium bug tracker: https://issues.chromium.org/issues/40113891
As a result, Chromium has now improved the keyboard a11y by allowing scrollable containers to be in the focus chain (unless tabindex < 0), similar to Firefox.
I.e. when tabbing through:
- If the scrollable container has
tabindex≥0, move the focus to the container. - If the scrollable container has
tabindex<0, skip the container. - If the scrollable container has no
tabindex:- Chromium [new]: move the focus to the container but only if the container does not contain any focusable element. E.g. if the container contains only texts. Otherwise, skip the container but jump to the inner focusable element directly. The container can still be keyboard scrolled with the focus there.
- Firefox: move the focus to the container regardless whether the container has a focusable element or not.
- Safari: ...? "Safari has a user setting that can change what types of elements become keyboard focusable" according to the discussion in the Blink dev group linked below.
Steps to reproduce
- Start Chrome. If the new change is not already enabled by default:
- Kill all Chrome instances that are still running.
- From a CLI, navigate to the directory where the Chrome executable is located.
- Start Chrome with the option
--enable-blink-features=KeyboardFocusableScrollers.
- Open https://output.jsbin.com/yajesab
- Move the focus to the scroll area with the keyboard which is possible now thanks to the Chromium change.
Issue: the focus indicator is unstyled in UI5.
Request to consider
- Deprecation: the
focusableproperty of thesap.m.ScrollContainercan be deprecated since the browsers supported by UI5 set the focus automatically depending on the container content and thetabindex. - Fixes:
-
sap.m.PageRenderercurrently avoids being in the focus chain only in Firefox.
https://github.com/SAP/openui5/blob/d5f5e16e8ac3c204b8bfa79c3cfbfa390d203915/src/sap.m/src/sap/m/PageRenderer.js#L152 In my view, this special handling needs to be removed, allowing the default browser behavior to take effect. - Unstyled focus indicator when the Page receives the focus and scrolls. This was initially reported in the past (https://github.com/SAP/openui5/issues/2785) but was closed with the above special handling for Firefox.
-
Remaining questions
- What is the exact behavior in Safari regarding this topic? Does Safari need a special handling in UI5?
- Is the behavior of the browsers same across all OS supported by UI5? Any system settings that could affect?
More information
"Intent to Ship: Keyboard-focusable scroll containers" - "Blink-dev" group
Changes regarding the topic KeyboardFocusableScrollers - "Blink Reviews" group
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.