Spaces:
Sleeping
Sleeping
calycekr
commited on
fix: add tick() to prevent textarea height adjustment failures (#1854)
Browse files- Add tick() after adjustTextareaHeight() in handleKeydown to ensure DOM updates are completed before the submit event is dispatched.
src/lib/components/chat/ChatInput.svelte
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
<script lang="ts">
|
| 2 |
-
import { createEventDispatcher, onMount } from "svelte";
|
| 3 |
|
| 4 |
import HoverTooltip from "$lib/components/HoverTooltip.svelte";
|
| 5 |
import IconInternet from "$lib/components/icons/IconInternet.svelte";
|
|
@@ -110,6 +110,7 @@
|
|
| 110 |
) {
|
| 111 |
event.preventDefault();
|
| 112 |
adjustTextareaHeight();
|
|
|
|
| 113 |
dispatch("submit");
|
| 114 |
}
|
| 115 |
}
|
|
|
|
| 1 |
<script lang="ts">
|
| 2 |
+
import { createEventDispatcher, onMount, tick } from "svelte";
|
| 3 |
|
| 4 |
import HoverTooltip from "$lib/components/HoverTooltip.svelte";
|
| 5 |
import IconInternet from "$lib/components/icons/IconInternet.svelte";
|
|
|
|
| 110 |
) {
|
| 111 |
event.preventDefault();
|
| 112 |
adjustTextareaHeight();
|
| 113 |
+
tick();
|
| 114 |
dispatch("submit");
|
| 115 |
}
|
| 116 |
}
|