Skip to content
This repository was archived by the owner on Sep 26, 2022. It is now read-only.

Commit ddfde60

Browse files
authored
Fix not updating autogrow height when value is falsy
1 parent d8596c3 commit ddfde60

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/svelte-materialify/src/components/Textarea/Textarea.svelte

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,13 @@
5959
function onInput() {
6060
if (!validateOnBlur) validate();
6161
}
62-
63-
$: if (textarea && value && autogrow) {
62+
63+
function updateTextareaHeight() {
6464
textarea.style.height = 'auto';
6565
textarea.style.height = `${textarea.scrollHeight}px`;
6666
}
67+
68+
$: if (textarea && autogrow) updateTextareaHeight(value);
6769
</script>
6870

6971
<Input

0 commit comments

Comments
 (0)