fix(HoverCard): add type assertion for event target in click handler

This commit is contained in:
Fx64b
2025-11-18 20:05:17 +01:00
parent 3d4bbf77bc
commit 803c7907f1

View File

@ -39,7 +39,7 @@ const {title, description, image = "", date} = Astro.props;
// Close card when clicking outside (mobile only)
document.addEventListener('click', (e) => {
if (window.innerWidth <= 768 && !card.contains(e.target)) {
if (window.innerWidth <= 768 && !card.contains(e.target as Node)) {
card.classList.remove('active');
}
});