Skip to content

Commit

Permalink
Don't change option value if new value is blank
Browse files Browse the repository at this point in the history
  • Loading branch information
j433866 committed May 16, 2019
1 parent f51ee76 commit 6f5018d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/web/HTMLIngredient.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 6f5018d

Please sign in to comment.