stdlib-js / www

Website for stdlib, a standard library for JavaScript and Node.js.
https://stdlib.io
Apache License 2.0
6 stars 8 forks source link

[Bug]: focus does not reset upon navigating to a new API docs page #37

Closed kgryte closed 2 years ago

kgryte commented 2 years ago

Description

Encountered an error when navigating to a new API docs page.

When I click on a navigation element (e.g., clicking on a link to navigate to the "next" package), the focus stays on the navigation element. This means that, for those with screen readers, they are unable to begin tabbing through the new page's content. Instead, hitting TAB picks up where they left off on the previous page.

The preferred approach here is that we reset the focus to the top of the page to the skip-link so that users can either TAB through navigation or skip to the main content.

Related Issues

No.

Questions

No.

Demo

N/A

Reproduction

-   navigate to a package on the API docs website.
-   use a navigational element to navigate to a new package.
-   notice that the focus does not reset.

Expected Results

-   the focus should reset.

Actual Results

-   the focus remains on the previously focused element (where applicable).

Environments

Firefox, Chrome, Safari, Microsoft Edge, Internet Explorer

Browser Version

No response

Node.js / npm Version

No response

Platform

No response

Checklist

kgryte commented 2 years ago

This has been resolved and is now deployed.