Skip to content

Commit

Permalink
fix(Drawer): overlay 위치 수정
Browse files Browse the repository at this point in the history
- 페이지 이동할 때 마다 ovelay가 보였다가 안보이는 이슈가 있어서 수정
  • Loading branch information
0jenn0 committed Oct 23, 2024
1 parent c9a4c31 commit 4d13007
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions frontend/src/components/common/Drawer/Drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,16 @@ const Drawer = ({ children }: React.PropsWithChildren) => {
{isOpen ? "사용자 메뉴가 열렸습니다." : "사용자 메뉴가 닫혔습니다."}
</VisuallyHidden>
{otherContent}
<S.Overlay isOpen={isOpen} onClick={toggle} />

{isRendered &&
ReactDOM.createPortal(
<S.DrawerContainer id="drawer-content" isOpen={isOpen} aria-modal="true" role="dialog">
{headerContent}
{drawerContent}
</S.DrawerContainer>,

<>
<S.Overlay isOpen={isOpen} onClick={toggle} />
<S.DrawerContainer id="drawer-content" isOpen={isOpen} aria-modal="true" role="dialog">
{headerContent}
{drawerContent}
</S.DrawerContainer>
</>,
document.body,
)}
</DrawerProvider>
Expand Down

0 comments on commit 4d13007

Please sign in to comment.