combobox: improve props, fix placement with scroll
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user