Skip to content

Commit 2360be8

Browse files
authored
fix: add tick() to prevent textarea height adjustment failures (#1854)
- Add tick() after adjustTextareaHeight() in handleKeydown to ensure DOM updates are completed before the submit event is dispatched.
1 parent 5e7dbfa commit 2360be8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/lib/components/chat/ChatInput.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts">
2-
import { createEventDispatcher, onMount } from "svelte";
2+
import { createEventDispatcher, onMount, tick } from "svelte";
33
44
import HoverTooltip from "$lib/components/HoverTooltip.svelte";
55
import IconInternet from "$lib/components/icons/IconInternet.svelte";
@@ -110,6 +110,7 @@
110110
) {
111111
event.preventDefault();
112112
adjustTextareaHeight();
113+
tick();
113114
dispatch("submit");
114115
}
115116
}

0 commit comments

Comments
 (0)