Skip to content

Commit

Permalink
feat : addOkr objTitleCateg에서 동일 카테고리 재선택시 취소 로직 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Yeonseo-Jo committed May 2, 2024
1 parent 4df7716 commit b810a34
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/AddOkr/components/stepLayout/ObjTitleCateg.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ const ObjTitleCateg = ({ isGuide, objInfo, setObjInfo }: IObjTitleCategProps) =>
**/
// 카테고리 태그 선택 핸들러
const handleClickObjCateg = (e: React.MouseEvent<HTMLButtonElement>) => {
const currSelectedCateg = e.currentTarget.id;

// 카테고리 재선택시 취소
if (currSelectedCateg === selectedObjCateg) {
setObjInfo({ ...objInfo, objCategory: '' });
return;
}

setObjInfo({ ...objInfo, objCategory: e.currentTarget.id });
};

Expand Down

0 comments on commit b810a34

Please sign in to comment.