combobox: improve props, fix placement with scroll

This commit is contained in:
Elijah Duffy
2025-07-03 10:57:21 -07:00
parent f2994abad2
commit a307ffee92
6 changed files with 60 additions and 37 deletions

View File

@@ -5,6 +5,7 @@
<script lang="ts">
import type { Snippet } from 'svelte';
import { validate } from '@svelte-toolkit/validate';
import { generateIdentifier } from './util.js';
interface Props {
name?: string;
@@ -24,9 +25,7 @@
onchange
}: Props = $props();
let id = $derived.by(() => {
return `checkbox-${name || Math.random().toString(36).substring(2, 15)}`;
});
let id = $derived(generateIdentifier('checkbox', name));
let valid = $state(true);
</script>