diff --git a/src/_includes/global/navbar.njk b/src/_includes/global/navbar.njk index 10675edc..ae5b0e8f 100644 --- a/src/_includes/global/navbar.njk +++ b/src/_includes/global/navbar.njk @@ -118,4 +118,13 @@ closeNavigation(); } }); + + const handleBlur = () => { + const navList = event.currentTarget.closest(".navbar__links"); + if (!event.relatedTarget || !navList.contains(event.relatedTarget)) { + closeNavigation(); + } + } + + navbarLinkItems[navbarLinkItems.length - 1].addEventListener("blur", handleBlur); \ No newline at end of file