Skip to content

Commit

Permalink
Merge pull request #285 from pixiv/toshusai/fix-docs-sidemenu
Browse files Browse the repository at this point in the history
fix: サイドメニューの開閉動作を修正
  • Loading branch information
toshusai authored Mar 27, 2023
2 parents 5ab94d3 + 17c6655 commit 0e3c9f3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion docs/src/components/AppHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ export const AppHeader: FC = () => {
const state = useOverlayTriggerState({})
const router = useRouter()
useEffect(() => {
state.close()
const handleRouterChangeStart = () => {
state.close()
}
router.events.on('routeChangeStart', handleRouterChangeStart)
return () => {
return router.events.off('routeChangeStart', handleRouterChangeStart)
}
}, [router.pathname, state])
return (
<HeaderRoot>
Expand Down

0 comments on commit 0e3c9f3

Please sign in to comment.