Skip to content

Commit

Permalink
BaseInput.js: Avoid a dangling dataInput value
Browse files Browse the repository at this point in the history
Upon removal an auto submit is unconditionally fired.
i.e. even without any removed terms, it is. The submit
didn't ran in this case, but the data input was populated
anyway.
  • Loading branch information
nilmerg committed Apr 27, 2023
1 parent f6c0900 commit 5ca2aa6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions asset/js/widget/BaseInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -574,12 +574,12 @@ define(["../notjQuery", "Completer"], function ($, Completer) {
}
}

this.dataInput.value = JSON.stringify({
type: changeType,
terms: changedTerms
});

if (Object.keys(changedTerms).length) {
this.dataInput.value = JSON.stringify({
type: changeType,
terms: changedTerms
});

$(this.input.form).trigger('submit', { submittedBy: input });
}
}
Expand Down

0 comments on commit 5ca2aa6

Please sign in to comment.