Skip to content

Commit

Permalink
Fix: 부모 클릭 이벤트 전파 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
imddoy committed Jan 24, 2025
1 parent 996e94e commit 47ec1d6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
18 changes: 17 additions & 1 deletion src/pages/myPage/components/postCard/PostCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,23 @@ const PostCard = ({ boardId, isMine, title, updatedAt, toolLogo, toolName, onCli
<S.Title>{title}</S.Title>
<S.Date>{updatedAt}</S.Date>
<S.ButtonWrapper>
{isMine ? <button onClick={onClick}>삭제</button> : <IcMypageBookmark32 onClick={onClick} />}
{isMine ? (
<button
onClick={(event) => {
event.stopPropagation();
onClick?.();
}}
>
삭제
</button>
) : (
<IcMypageBookmark32
onClick={(event) => {
event.stopPropagation();
onClick?.();
}}
/>
)}
</S.ButtonWrapper>
</S.CardWrapper>
);
Expand Down
7 changes: 6 additions & 1 deletion src/pages/myPage/components/toolCard/MyToolCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ const MyToolCard = ({ toolId, toolLogo, toolNameMain, keyWordList, onClick }: My
</Chip>
))}
</S.CardKeyword>
<S.BookmarkBtn onClick={onClick} />
<S.BookmarkBtn
onClick={(event) => {
event.stopPropagation();
onClick?.();
}}
/>
</S.CardWrapper>
);
};
Expand Down

0 comments on commit 47ec1d6

Please sign in to comment.