Skip to content

fix: match active links by path and query - #3921

Open
jakezwang wants to merge 1 commit into
freshframework:mainfrom
jakezwang:fix/query-sensitive-active-links
Open

jakezwang wants to merge 1 commit into
freshframework:mainfrom
jakezwang:fix/query-sensitive-active-links

Conversation

@jakezwang

Copy link
Copy Markdown

When a page uses query parameters for tabs or filters, the link to the unfiltered view can stay marked aria-current="page" after navigating to a filtered view. Links to other query values can also be announced as current.

Match the query whenever the URL paths are equal. The link for the exact URL gets aria-current="page". True path ancestors keep their existing behavior.

The regression tests failed on both a direct page load and a client-side partial navigation before the fix. The client test also verifies that the original link outside the partial remains in the document during navigation. deno task ok passed on Deno 2.8.2 with 626 tests passed and 13 ignored.

Fixes #3920

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Active links: a query-less link stays aria-current="page" after navigating to the same path with a query (two current links)

1 participant