Spaces:
Sleeping
Sleeping
[Fix] dynamic textarea reset when toggling between code snippets and input messages
Browse files123456715 unmodified lines232425262728293026 unmodified lines575859606162<script lang="ts">import type { Conversation } from "$lib/components/InferencePlayground/types";import { createEventDispatcher } from "svelte";import CodeSnippets from "./InferencePlaygroundCodeSnippets.svelte";import Message from "./InferencePlaygroundMessage.svelte";15 unmodified lineslet messageContainer: HTMLDivElement | null = null;function resizeMessageTextAreas() {// ideally we would use CSS "field-sizing:content". However, it is currently only supported on Chrome.if (messageContainer) {const containerScrollTop = messageContainer.scrollTop;const textareaEls = messageContainer.querySelectorAll("textarea");26 unmodified linesconversationLength = conversation.messages.length;shouldScrollToBottom = true;}</script><div123456715 unmodified lines23242526272829303126 unmodified lines5859606162636465<script lang="ts">import type { Conversation } from "$lib/components/InferencePlayground/types";import { createEventDispatcher, tick } from "svelte";import CodeSnippets from "./InferencePlaygroundCodeSnippets.svelte";import Message from "./InferencePlaygroundMessage.svelte";15 unmodified lineslet messageContainer: HTMLDivElement | null = null;async function resizeMessageTextAreas() {// ideally we would use CSS "field-sizing:content". However, it is currently only supported on Chrome.await tick();if (messageContainer) {const containerScrollTop = messageContainer.scrollTop;const textareaEls = messageContainer.querySelectorAll("textarea");26 unmodified linesconversationLength = conversation.messages.length;shouldScrollToBottom = true;}$: viewCode, resizeMessageTextAreas();</script><div
src/lib/components/InferencePlayground/InferencePlaygroundConversation.svelte+5-2