diff --git a/components/common/CommonRouteTabs.vue b/components/common/CommonRouteTabs.vue index dc2850e5..8b65cdaf 100644 --- a/components/common/CommonRouteTabs.vue +++ b/components/common/CommonRouteTabs.vue @@ -50,7 +50,7 @@ const handleClick = (to: RouteLocationRaw) => { tabindex="1" hover:bg-active transition-100 exact-active-class="children:(text-secondary !border-primary !op100 !text-base)" - @click="handleClick(option.to)" + @click.capture="handleClick(option.to)" > {{ option.display }} diff --git a/components/nav/NavSideItem.vue b/components/nav/NavSideItem.vue index aa9c9243..eea8d470 100644 --- a/components/nav/NavSideItem.vue +++ b/components/nav/NavSideItem.vue @@ -15,6 +15,7 @@ defineSlots<{ }>() const router = useRouter() +const nuxtApp = useNuxtApp() useCommand({ scope: 'Navigation', @@ -41,6 +42,13 @@ onMastoInit(async () => { // when we know there is no user. const noUserDisable = computed(() => !isMastoInitialised.value || (props.userOnly && !currentUser.value)) const noUserVisual = computed(() => isMastoInitialised.value && props.userOnly && !currentUser.value) + +const handleClick = () => { + if (nuxtApp.$preventScrollToTop(router.resolve(props.to).fullPath)) + return + + nuxtApp.$scrollToTop() +}