From bead2183b289de3dd4a5f66b4a005d7a50900687 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20S=C3=A1nchez?= Date: Wed, 3 Apr 2024 15:59:42 +0200 Subject: [PATCH] fix(ui): don't scroll on settings item click when external or `_blank` target link (#2742) --- components/settings/SettingsItem.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/settings/SettingsItem.vue b/components/settings/SettingsItem.vue index ddce93b7..324a752b 100644 --- a/components/settings/SettingsItem.vue +++ b/components/settings/SettingsItem.vue @@ -10,9 +10,11 @@ const props = defineProps<{ external?: true large?: true match?: boolean + target?: string }>() const router = useRouter() +const scrollOnClick = computed(() => props.to && !(props.target === '_blank' || props.external)) useCommand({ scope: 'Settings', @@ -39,11 +41,12 @@ useCommand({ :disabled="disabled" :to="to" :external="external" + :target="target" exact-active-class="text-primary" :class="disabled ? 'op25 pointer-events-none ' : match ? 'text-primary' : ''" block w-full group focus:outline-none :tabindex="disabled ? -1 : null" - @click="to ? $scrollToTop() : undefined" + @click="scrollOnClick ? $scrollToTop() : undefined" >