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 28, 2023
1 parent 95f680c commit 376cc1b
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 @@ -575,12 +575,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 376cc1b

Please sign in to comment.