Skip to content

fix(A): set aria-current only when the query matches too - #722

Merged
ryansolid merged 1 commit into
mainfrom
claude/project-thread-db7w8c
Nov 11, 2026
Merged

ryansolid merged 1 commit into
mainfrom
claude/project-thread-db7w8c

Conversation

@ryansolid

Copy link
Copy Markdown
Member

Requested by Ryan · project thread

Fixes #518.

Problem

<A> set aria-current="page" whenever the link's pathname matched the location's. The link's query was removed before the comparison, so filter links like /?tag=a, /?tag=b and /?tag=c were all marked as the current page at once.

Change

The current-page check now also requires the link's search params to equal the location's, ignoring parameter order and the hash. This is the same rule 2.0 uses for current and aria-current (linkMatcher on next). The active and inactive classes still match on the path only, so existing styling is unchanged.

This replaces #720: it fixes the wrong aria-current with no new activeOptions API, and it matches what 2.0 does.

Tests

There's a new case in test/anchor.spec.tsx that fails without the fix. pnpm test passes, including the SSR and type suites. The changeset is a patch.


Generated by Claude Code

Filter links like /?tag=a and /?tag=b were all marked aria-current="page"
because only the pathname was compared. The current-page state now also
requires the link's search params to match the location's, ignoring order,
the same rule 2.0 uses. The active class keeps matching on the path.

Fixes #518

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWPn7eCrWhevqJzoZeX
@changeset-bot

changeset-bot Bot commented Nov 11, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 18991b8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@solidjs/router Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ryansolid ryansolid added the 1.x label Nov 11, 2026 — with Claude
@ryansolid ryansolid self-assigned this Nov 11, 2026
@ryansolid
ryansolid merged commit 821b7e1 into main Nov 11, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A active does not account for search params

2 participants