Skip to content

Commit c832809

Browse files
heiskrCopilot
andauthored
Improve hash focus: handle initial page load (#60298)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent a47b109 commit c832809

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/frame/components/ClientSideHashFocus.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ export function ClientSideHashFocus() {
1717
}
1818
}
1919

20+
// Handle initial page load with a hash (e.g. direct link to
21+
// docs.github.com/en/discussions#guides-2)
22+
handleHashChange()
23+
2024
window.addEventListener('hashchange', handleHashChange)
2125
return () => window.removeEventListener('hashchange', handleHashChange)
2226
}, [])

0 commit comments

Comments
 (0)