Browse Source

Merge pull request #2107 from Yidadaa/bugfix-0623

fix: #2087 chat box font size use global config
Yifei Zhang 1 year ago
parent
commit
56bc945335
2 changed files with 4 additions and 0 deletions
  1. 3 0
      app/components/chat.tsx
  2. 1 0
      app/utils.ts

+ 3 - 0
app/components/chat.tsx

@@ -927,6 +927,9 @@ export function Chat() {
             onBlur={() => setAutoScroll(false)}
             rows={inputRows}
             autoFocus={autoFocus}
+            style={{
+              fontSize: config.fontSize,
+            }}
           />
           <IconButton
             icon={<SendWhiteIcon />}

+ 1 - 0
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(