Skip to content

Commit

Permalink
BaseInput.js: Always reset the data input's value upon submit
Browse files Browse the repository at this point in the history
The current terms, if any, are set as json on the input. Though,
if there are none, the input was not reset and the previous json
was submitted again.
  • Loading branch information
nilmerg committed Aug 10, 2023
1 parent 16e7df6 commit e644abe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions asset/js/widget/BaseInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -956,9 +956,13 @@ define(["../notjQuery", "Completer"], function ($, Completer) {

// This is not part of `onSubmit()` because otherwise it would override what `autoSubmit()` does
this.dataInput.value = JSON.stringify({ type: 'submit', terms: this.usedTerms });

return;
} else if (this.manageRequired && ! this.hasTerms()) {
this.input.required = true;
}

this.dataInput.value = '';
}

onPaste(event) {
Expand Down

0 comments on commit e644abe

Please sign in to comment.