소스 검색

Don't change option value if new value is blank

j433866 6 년 전
부모
커밋
6f5018d45e
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      src/web/HTMLIngredient.mjs

+ 3 - 1
src/web/HTMLIngredient.mjs

@@ -293,7 +293,9 @@ class HTMLIngredient {
         const op = el.parentNode.parentNode;
         const target = op.querySelectorAll(".arg")[this.target];
 
-        target.value = el.childNodes[el.selectedIndex].getAttribute("populate-value");
+        const popVal = el.childNodes[el.selectedIndex].getAttribute("populate-value");
+        if (popVal !== "") target.value = popVal;
+
         const evt = new Event("change");
         target.dispatchEvent(evt);