Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Focus is not reset to top of DOM on route change #1083

Open
@davidluhr

Description

@davidluhr

Describe the bug
Current, route changes leave keyboard focus in the same position in the DOM and do not announce a new page has loaded.

I see issue #287 was closed, and was happy to see @Rich-Harris bring this up, but it doesn't seem to have been implemented. My apologies if I'm missing something, but my own testing shows this issue still exists.

To Reproduce

  1. Use a screen reader (VoiceOver, NVDA, etc.)
  2. In any Sapper project with more than one route, navigate to a link that points to another route
  3. Activate the link
  4. Observe the screen reader does not announce anything, and keyboard focus remains in the position in the DOM.

Expected behavior
For accessibility, focus should be reset to the top of the DOM on route change and match native browser behavior when navigating to a new URL. Natively, a new URL will announce the new <title> to assistive technology and focus will begin at the top of the DOM so users can navigate through the new page.

Without this functionality, there's no way for screen reader users to know the route changed, or to know where keyboard focus is in the DOM.

Severity
I view this as a critical bug. This has prevented me from using Sapper for my projects, because I cannot exclude many users from being able to use the website. Users who rely on assistive technologies constitute a sizeable global population, and Sapper has an opportunity to lead the way in creating an accessible SPA-like experience that front-end frameworks are lacking.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions