From 5ca2aa630e1361a8f593a14cbef82abaced1af17 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 27 Apr 2023 12:00:24 +0200 Subject: [PATCH] BaseInput.js: Avoid a dangling dataInput value 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. --- asset/js/widget/BaseInput.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/asset/js/widget/BaseInput.js b/asset/js/widget/BaseInput.js index cd7d6a47..2e0f7f4e 100644 --- a/asset/js/widget/BaseInput.js +++ b/asset/js/widget/BaseInput.js @@ -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 }); } }