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