Commit 9eec3f0
committed
fix(docs[spa-nav]): always navigate on popstate to fix back-button content update
why: The popstate handler guarded on `e.state && e.state.spa`, but
browsers can deliver null state for the initial history entry even
after replaceState({spa: true}). This caused three symptoms:
- Back button changed URL but didn't update page content
- Sidebar links resolved wrong after back-navigating across depths
- Brand logo href went stale after SPA navigation
what:
- Remove state guard from popstate handler — always call navigate()
- Safe: navigate() falls back to full page load on error, and
isPop=true prevents pushing duplicate history entries1 parent b318772 commit 9eec3f0
File tree
1 file changed
+2
-2
lines changed- docs/_static/js
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
206 | | - | |
207 | | - | |
| 206 | + | |
| 207 | + | |
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
| |||
0 commit comments