Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions packages/ui/src/lib/components/Textarea/Textarea.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
import { styleVariants } from '$lib/styles.js';
import type { TextareaProps } from '$lib/types.js';
import { cleanClass, generateId } from '$lib/utilities/internal.js';
import { onMount } from 'svelte';
import type { FormEventHandler } from 'svelte/elements';
import { tv } from 'tailwind-variants';

let {
Expand Down Expand Up @@ -75,12 +73,10 @@
}
};

const onInput: FormEventHandler<HTMLTextAreaElement> = (event) => {
autogrow(event.target as HTMLTextAreaElement);
restProps?.oninput?.(event);
};

onMount(() => autogrow(ref));
$effect(() => {
void value;
autogrow(ref);
});
</script>

<div class="flex w-full flex-col gap-1" bind:this={containerRef}>
Expand All @@ -94,7 +90,6 @@

<div class="relative w-full">
<textarea
oninput={onInput}
id={inputId}
aria-labelledby={label && labelId}
required={!!required}
Expand Down
Loading