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

  1. Navigate to a Drupal view page with an AJAX filter (having auto-submit enabled) using a keyboard interface.
  2. Select a filter option radio button
  3. 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

Command icon 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:

Comments

adambraun created an issue. See original summary.

adambraun changed the visibility of the branch 3562910-keyboard-focus-not to hidden.

adambraun changed the visibility of the branch 3562910-keyboard-focus-not to active.

mdranove’s picture

Status: Active » Reviewed & tested by the community

I 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

  • smustgrave committed 31f8788e on 7.1.x
    feat: #3562910 Keyboard focus not properly managed after AJAX filter...

smustgrave’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

smustgrave’s picture

Version: 7.1.x-dev » 7.0.x-dev
Status: Fixed » Patch (to be ported)

Lets backport to 7.0.x, doesn't apply cleanly

smustgrave’s picture

Version: 7.0.x-dev » 7.1.x-dev
Status: Patch (to be ported) » Fixed

Actually original code appears to be only in 7.1.x so lets just land there.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.