From fa9ceb587503d1597754f9a0f4a5ffbe41447b85 Mon Sep 17 00:00:00 2001 From: Yidadaa Date: Fri, 23 Jun 2023 20:57:43 +0800 Subject: [PATCH] fix: #2087 chat box font size use global config --- app/components/chat.tsx | 3 +++ app/utils.ts | 1 + 2 files changed, 4 insertions(+) diff --git a/app/components/chat.tsx b/app/components/chat.tsx index 0f1bad64..047607d4 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -927,6 +927,9 @@ export function Chat() { onBlur={() => setAutoScroll(false)} rows={inputRows} autoFocus={autoFocus} + style={{ + fontSize: config.fontSize, + }} /> } diff --git a/app/utils.ts b/app/utils.ts index 120b1e15..c083c34f 100644 --- a/app/utils.ts +++ b/app/utils.ts @@ -152,6 +152,7 @@ export function autoGrowTextArea(dom: HTMLTextAreaElement) { const width = getDomContentWidth(dom); measureDom.style.width = width + "px"; measureDom.innerText = dom.value !== "" ? dom.value : "1"; + measureDom.style.fontSize = dom.style.fontSize; const endWithEmptyLine = dom.value.endsWith("\n"); const height = parseFloat(window.getComputedStyle(measureDom).height); const singleLineHeight = parseFloat(