pulls inline code into separate handleClickLink function to deal with closing side panel when navigating away

This commit is contained in:
mikesealey 2024-04-19 12:08:05 +01:00
parent 237bc70758
commit 11702538cb
1 changed files with 6 additions and 2 deletions

View File

@ -194,6 +194,11 @@
}
return url
}
const handleClickLink = () => {
mobileOpen = false
sidePanelStore.actions.close()
}
</script>
<!-- svelte-ignore a11y-no-static-element-interactions -->
@ -284,8 +289,7 @@
url={navItem.url}
subLinks={navItem.subLinks}
internalLink={navItem.internalLink}
on:clickLink={(() => (mobileOpen = false),
sidePanelStore.actions.close)}
on:clickLink={handleClickLink}
leftNav={navigation === "Left"}
{mobile}
{navStateStore}