diff --git a/site/source/design-system/drawer/Drawer.tsx b/site/source/design-system/drawer/Drawer.tsx index 7cbb0adb8..e1303608e 100644 --- a/site/source/design-system/drawer/Drawer.tsx +++ b/site/source/design-system/drawer/Drawer.tsx @@ -2,6 +2,7 @@ import FocusTrap from 'focus-trap-react' import { ReactNode, useCallback, useEffect, useRef, useState } from 'react' import ReactDOM from 'react-dom' import { Trans } from 'react-i18next' +import { useLocation } from 'react-router-dom' import styled, { css } from 'styled-components' import { useOnClickOutside } from '@/hooks/useOnClickOutside' @@ -92,6 +93,12 @@ export const Drawer = ({ closeDrawer() }) + const location = useLocation() + + useEffect(() => { + closeDrawer() + }, [closeDrawer, location]) + return ( <> {trigger({