[2.0.1] hashHistory: link claims and useLinkState ignore the hash, so aria-current/data-active are wrong on every link
維護者通常 1 天內回覆
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 72/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- typescript
- 領域
- frontend
研究方向
Start by tracing how hashHistory() represents the current location and how link claims and useLinkState compare it with paths nodes and string URLs. The report includes a reproduction app, so use it to check / and /applications in hash mode, then compare with browserHistory(). Done means only the link for the current page receives aria-current="page" and data-active in both routes.
由索引模型根據 Issue 內容生成。
描述
Describe the bug
With hashHistory(), the router puts aria-current="page" and data-active on the wrong links.
In hash mode, links built with paths render as #/ and #/applications:
- On
/#/, both links are marked as current and active. - On
/#/applications, neither link is marked.
What works correctly:
- Navigation: clicking the links goes to the right page.
- The same app with
browserHistory(): only the current page's link is marked. useLinkStategiven apathsnode. Given the plain string"#/applications", it is wrong too (inverted).
Versions: @solidjs/router 2.0.1 (also 2.0.0 and current main), solid-js 2.0.3, @solidjs/web 2.0.3, @solidjs/vite-plugin 3.0.1, vite 8.3.8.
Your Example Website or App
https://github.com/hapreanmanuel/solid-router-hashhistory-link-state-bug
Steps to Reproduce the Bug or Issue
- Open the app on
/#/(Home). Both links are highlighted:<a href="#/">and<a href="#/applications">both havearia-current="page"anddata-active. - Click "Applications". The Applications page renders, but neither link has
aria-currentordata-active. - Reload the page on
/#/applications. Still neither link.
Expected behavior
Only the link to the current page is marked, like with browserHistory():
- On
/#/, only Home hasaria-current="page"anddata-active. - On
/#/applications, only Applications does.
Screenshots or Videos
No response
Platform
- OS: Windows 11
- Browser: Chrome, reproduced in Chromium 156
- Version: @solidjs/router 2.0.1
Additional context
Claude Code has helped me discover this bug, as well as building the sample to showcase it and report it.
I did my best to understand and check it myself before reporting it, as well as searching the active submitted issues for it, without finding any match.
- 主要語言
- TypeScript
- 星號
- 1.3k
- 分支
- 193
- 平均合併
- 8 小時 48 分鐘
- 30 天內合併 PR
- 21
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
solidjs/solid-router 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 77/100
solidjs/solid-router#757 ·
維護者通常 1 天內回覆
-
[2.0.1] Internal links do a full page load on a custom scheme (Electron app://)可能已有人在做 @saudademjj 於 1 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 20/100
solidjs/solid-router#755 · 1 則留言 ·
維護者通常 1 天內回覆
-
[2.0.1] diagnostics: a request for // crashes the dev server (Invalid URL in describeInitial)可能已有人在做 @bryanlundberg 於 4 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 35/100
solidjs/solid-router#752 ·
維護者通常 1 天內回覆
-
liveQuery SSR: the producer of a `live()` server function is never finalized after the response ends (the `return()` queues behind a read-ahead `next()`)可能已有人在做 @clean99 於 2 天前認領。 未關閉
難度 4/5 3-5 天 新手友好度 48/100
solidjs/solid-router#751 ·
維護者通常 1 天內回覆
-
難度 4/5 3-5 天 新手友好度 48/100
solidjs/solid-router#736 · 1 則留言 ·
維護者通常 1 天內回覆
查看 solidjs/solid-router 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 75/100
維護者通常 1 天內回覆
-
Make the "%" unit spacing the same in the web and in A10可能已有人在做 @kragent66-glitch 今天認領。 未關閉bug good first issue
難度 2/5 1-3 小時 新手友好度 74/100
maiychrus25/OpenTea-DX-OS#226 · 1 則留言 ·
-
bug
難度 2/5 1-3 小時 新手友好度 66/100
nextcloud-libraries/nextcloud-dialogs#2772 ·
維護者通常 1 天內回覆
-
Editor: leave an uploaded or inserted image's alt text empty, so the preview asks for a description未關閉
難度 2/5 1-3 小時 新手友好度 83/100
維護者通常 1 天內回覆
-
難度 1/5 1-3 小時 新手友好度 65/100
sveltejs/svelte.dev#2417 ·
維護者通常 1 天內回覆