Freelock Emphasizes Focus Order and Visibility in Day 4 of Drupal Advent Calendar
Freelock’s Day 4 Drupal Advent Calendar entry shines a spotlight on two essential yet often overlooked aspects of accessibility, focus order and focus visibility, emphasizing their role in ensuring websites are fully navigable for keyboard-only users.
Users navigating with keyboards, including screen reader users and individuals with motor impairments, depend on a logical tab sequence and visible focus indicators to interact with websites effectively. Freelock highlights two relevant WCAG success criteria: 2.4.3 Focus Order, which ensures a meaningful navigation sequence, and 2.4.7 Focus Visible, which requires that focused elements be clearly indicated visually.
The post outlines common problems such as CSS disrupting source order, modal dialogs lacking focus traps, and designers removing default outlines for aesthetic reasons. These design choices may leave users guessing which element is active or cause them to jump unpredictably across the page. Freelock emphasizes that when someone presses Tab, they should move smoothly through menus, forms, and interactive elements in a top-to-bottom, left-to-right reading sequence, especially in English-language content.
To fix these issues, Freelock recommends maintaining logical HTML source order, using semantic elements like <nav> and <main>, and including skip links for bypassing navigation. Focus visibility should be preserved or replaced with custom styles that meet contrast and thickness standards. The post advises testing interfaces using only the keyboard and leveraging browser accessibility tools to visualize focus paths. It also warns developers using modern frameworks like React or Vue to manage focus programmatically and align keyboard behaviors with mouse actions.
Freelock concludes that although focus management may seem minor, it is critical to creating usable, inclusive digital experiences. Developers are encouraged to test regularly by unplugging their mouse and navigating their own sites—an exercise that often reveals hidden issues impacting accessibility.


