mirror of
https://github.com/elk-zone/elk.git
synced 2024-11-09 10:29:57 +00:00
fix(ui): don't scroll on settings item click when external or _blank
target link (#2742)
This commit is contained in:
parent
59dda09cd4
commit
bead2183b2
1 changed files with 4 additions and 1 deletions
|
@ -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"
|
||||
>
|
||||
<div
|
||||
w-full flex px5 py3 md:gap2 gap4 items-center
|
||||
|
|
Loading…
Reference in a new issue