Problem/Motivation
When using an AJAX filter on a Drupal view page having auto-submit enabled, the keyboard focus is not being properly managed during the update process. After a filter selection is made using a radio button, the focus shifts to the body element rather than being set to the same element / updated content. This makes it difficult for keyboard-only users and the users of assistive technology to understand the context of changes made to the view after a filter selection is made.
Steps to reproduce
- Navigate to a Drupal view page with an AJAX filter (having auto-submit enabled) using a keyboard interface.
- Select a filter option radio button
- Observe that the view updates with new content but the keyboard focus is not on the selected div.
Proposed resolution
When a user selects a radio button as a filter option, the view should be updated with the new content, and the keyboard focus should be set to the updated content or on the element that triggered the AJAX update.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork better_exposed_filters-3562910
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3562910-keyboard-focus-not
changes, plain diff MR !220
Comments
Comment #5
mdranove commentedI tested this out by reproing the issue with 7.0.x, and then checked out this branch and confirmed the fix.
I see test-only-changes not run, so I also ran the test against 7.0.x and confirmed it fails, dont have access to run test-only-changes so would recommend doing that, but moving to RTBC
Comment #8
smustgrave commentedComment #10
smustgrave commentedLets backport to 7.0.x, doesn't apply cleanly
Comment #11
smustgrave commentedActually original code appears to be only in 7.1.x so lets just land there.