Skip to content

Accessibility failure: page navigation scroll behavior does not move focus #6618

@NicktheGeek

Description

@NicktheGeek

🐛 Current behavior

It is possible to configure a scroll to target when setting up instasearch pagination:

pagination({
      ...
      scrollTo: '.selector',
      ...
})

After clicking a link in the pagination, scroll moves to reveal the indicated element.

This works great for sighted mouse users, but keyboard users will have to navigate backward through everything and as indicated in #6617, screen reader users have no idea anything happened.

🔍 Steps to reproduce

  1. Go to one of the demo pages like the eCommerce demo
  2. Use a keyboard to navigate to the pagination after the items
  3. Press enter to change the page
  4. It will scroll to the top, but if you press tab to navigate anywhere else, the screen jumps back to the bottom because focus remained at the bottom

Live reproduction

https://codesandbox.io/s/github/algolia/instantsearch/tree/templates/instantsearch.js

💭 Expected behavior

In a perfect world focus would move to the scrollTo target, BUT this may not be desired behavior so a focusOn argument should be added and focus should move to that element if provided.

Package version

4.78.1

Operating system

No response

Browser

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Scope: Templatingrequires majora change which could not be implemented without a backwards incompatibility

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions