From fce0079d5dc7fc0056379aa28089845cdb76493b Mon Sep 17 00:00:00 2001 From: calycekr <4094424+calycekr@users.noreply.github.com> Date: Fri, 4 Jul 2025 10:28:48 +0900 Subject: [PATCH] fix: Ensure deterministic height adjustment in handleKeydown Improved the existing logic by `tick().then()` in `handleKeydown` ensuring DOM updates are applied after the submit event is dispatched. --- src/lib/components/chat/ChatInput.svelte | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/components/chat/ChatInput.svelte b/src/lib/components/chat/ChatInput.svelte index 0242070f095..10572f562db 100644 --- a/src/lib/components/chat/ChatInput.svelte +++ b/src/lib/components/chat/ChatInput.svelte @@ -109,9 +109,10 @@ value.trim() !== "" ) { event.preventDefault(); - adjustTextareaHeight(); - tick(); dispatch("submit"); + tick().then(() => { + adjustTextareaHeight(); + }); } }