From 376cc1b0d6318f9729ebedd0a6795d71d2b63493 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 ca14a5ff..95de2bb2 100644 --- a/asset/js/widget/BaseInput.js +++ b/asset/js/widget/BaseInput.js @@ -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 }); } }