Skip to content

feat(A): optional activeOptions.search for query-aware active state - #720

Closed
junaidkhan80121 wants to merge 1 commit into
solidjs:mainfrom
junaidkhan80121:feat/a-active-search-params
Closed

junaidkhan80121 wants to merge 1 commit into
solidjs:mainfrom
junaidkhan80121:feat/a-active-search-params

Conversation

@junaidkhan80121

Copy link
Copy Markdown

Summary

  • Adds optional activeOptions={{ search: true }} on <A> so active class and aria-current can require the link's search params to match the current location.
  • Matching is a subset/multiset of the link's query keys (extra location keys allowed). A query-less href with search: true only matches an empty location search.
  • Default behavior stays path-only when activeOptions.search is omitted.

Closes #518

Test plan

  • pnpm test (unit + SSR + types)
  • CI green on this PR

Allow links to treat search params as part of active / aria-current matching so filter tabs are not all active at once (solidjs#518).
@changeset-bot

changeset-bot Bot commented Nov 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0c092a1

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 Minor

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

Copy link
Copy Markdown
Member

Thanks for picking up #518. We're going to fix it differently on 1.x: #722 makes aria-current="page" require the link's query to match the location's (ignoring order), with no new activeOptions API. That's the rule Router 2.0 uses for current/aria-current, so 1.x and 2.0 behave the same way. The active class stays path-only. Closing this in favor of #722.


Generated by Claude Code

@ryansolid ryansolid closed this Nov 11, 2026
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.

A active does not account for search params

2 participants