Changed target to current target

This commit is contained in:
maciekglowacki 2020-06-18 17:38:36 +02:00
parent 3f5e672e5c
commit 9c7900b022

View File

@ -13,7 +13,7 @@ export default function RightBar({ lectures, onGroupMouseOver, onGroupClick }: R
const [selectedCardId, setSelectedCardId] = useState<string | null>(null); const [selectedCardId, setSelectedCardId] = useState<string | null>(null);
const onCardClick = (e: React.MouseEvent) => { 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); selectedCardId === target.id ? setSelectedCardId(null) : setSelectedCardId(target.id);
}; };