From 9c7900b022ca060ae860e90233a039f0a16cb6fd Mon Sep 17 00:00:00 2001 From: maciekglowacki Date: Thu, 18 Jun 2020 17:38:36 +0200 Subject: [PATCH] Changed target to current target --- src/components/RightBar/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/RightBar/index.tsx b/src/components/RightBar/index.tsx index 89f5e61..4007716 100644 --- a/src/components/RightBar/index.tsx +++ b/src/components/RightBar/index.tsx @@ -13,7 +13,7 @@ export default function RightBar({ lectures, onGroupMouseOver, onGroupClick }: R const [selectedCardId, setSelectedCardId] = useState(null); const onCardClick = (e: React.MouseEvent) => { - const target = e.target as HTMLElement; + const target = e.currentTarget as HTMLElement; selectedCardId === target.id ? setSelectedCardId(null) : setSelectedCardId(target.id); };