fix: some errors
This commit is contained in:
1 parent
adc5dc3ad3
commit
04b29c1407
7 files changed
+22
-12
No files matched your search
@@ -8,14 +8,17 @@
|
||||
} from 'svelte-hero-icons'
|
||||
import Avatar from '../../Avatar.svelte'
|
||||
import type { Action } from './actions.svelte'
|
||||
import type { HTMLButtonAttributes } from 'svelte/elements'
|
||||
|
||||
interface Props {
|
||||
action: Action
|
||||
class?: string
|
||||
children?: import('svelte').Snippet
|
||||
onclick?: HTMLButtonAttributes['onclick']
|
||||
[key: string]: any
|
||||
}
|
||||
|
||||
let { action, class: clazz = '', children }: Props = $props()
|
||||
let { action, class: clazz = '', children, ...rest }: Props = $props()
|
||||
</script>
|
||||
|
||||
<Button
|
||||
@@ -27,6 +30,7 @@
|
||||
class="focus:bg-slate-200 focus:dark:bg-zinc-800 block w-full {clazz}"
|
||||
data-sveltekit-preload-code="viewport"
|
||||
data-sveltekit-preload-data="tap"
|
||||
{...rest}
|
||||
>
|
||||
{#if typeof action.icon === 'string'}
|
||||
<Avatar url={action.icon} width={20} />
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
let { open = $bindable(false), groups = $bindable([]) }: Props = $props()
|
||||
|
||||
let search = $state('')
|
||||
let container: HTMLElement = $state()
|
||||
let container: HTMLElement | undefined = $state()
|
||||
const dispatch = createEventDispatcher()
|
||||
let selectedIndex = $state(0)
|
||||
let filteredGroups: Group[] = $state([])
|
||||
@@ -202,6 +202,7 @@
|
||||
if (!browser) return
|
||||
|
||||
const listItems = container?.querySelectorAll('li')
|
||||
if (!listItems) return
|
||||
listItems[index % listItems.length].focus()
|
||||
listItems[index % listItems.length].scrollIntoView({
|
||||
behavior: 'smooth',
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
import { settings } from '$lib/settings.svelte.js'
|
||||
import { Button } from 'mono-svelte'
|
||||
import { Icon, type IconSource } from 'svelte-hero-icons'
|
||||
import type { HTMLButtonAttributes } from 'svelte/elements'
|
||||
|
||||
interface Props {
|
||||
href?: string | undefined
|
||||
|
||||
Reference in new issue
Block a user