Skip to content

Commit

Permalink
symmetric-input-output: Remove output when empty
Browse files Browse the repository at this point in the history
  • Loading branch information
eliandoran committed Jul 6, 2024
1 parent 2943a90 commit c8ef839
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/lib/components/symmetric-input-output.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,25 @@
function inputChanged(e) {
const value = e.detail || e.target?.value || "";
outputLog = "";
({ output: outputText, log: inputLog } = handleErrors(to, value));
if (value) {
({ output: outputText, log: inputLog } = handleErrors(to, value));
} else {
outputText = "";
inputLog = "";
}
}
function outputChanged(e) {
const value = e.detail || e.target.value || "";
inputLog = "";
({ output: inputText, log: outputLog } = handleErrors(from, value));
if (value) {
({ output: inputText, log: outputLog } = handleErrors(from, value));
} else {
inputText = "";
outputLog = "";
}
}
</script>
Expand Down

0 comments on commit c8ef839

Please sign in to comment.