Преглед на файлове

Merge pull request #1102 from BaiMeow/main

fix: use innerHTML may leads unexpected script execution
Yifei Zhang преди 1 година
родител
ревизия
a604644da7
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      app/utils.ts

+ 1 - 1
app/utils.ts

@@ -129,7 +129,7 @@ export function autoGrowTextArea(dom: HTMLTextAreaElement) {
 
   const width = getDomContentWidth(dom);
   measureDom.style.width = width + "px";
-  measureDom.innerHTML = dom.value.trim().length > 0 ? dom.value : "1";
+  measureDom.innerText = dom.value.trim().length > 0 ? dom.value : "1";
 
   const lineWrapCount = Math.max(0, dom.value.split("\n").length - 1);
   const height = parseFloat(window.getComputedStyle(measureDom).height);