From 29de18423b8ac1644b9622295eb9f13774e5d8f4 Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Tue, 6 Sep 2022 11:41:56 +0200 Subject: [PATCH] TermInput: Terms added by separator have correct attributes When the separator key is pressed after quoted string, the method `onKeyDown()` calls `this.exchangeTerm()` which later calls `readFullTerm()`. Here the string is still quoted add not trimed. But the attributes for label tag should be unquoted and trimmed. no matter added by separator or enter key --- asset/js/widget/TermInput.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/asset/js/widget/TermInput.js b/asset/js/widget/TermInput.js index 34ec69a9..595d4bd2 100644 --- a/asset/js/widget/TermInput.js +++ b/asset/js/widget/TermInput.js @@ -45,9 +45,10 @@ define(["../notjQuery", "BaseInput"], function ($, BaseInput) { addTerm(termData, termIndex = null) { if (this.ignoreSpaceUntil !== null) { if (this.ignoreSpaceSince === 0 && termData.label[this.ignoreSpaceSince] === this.ignoreSpaceUntil) { - termData.label = termData.label.slice(1, -1); + this.writePartialTerm(termData.label.slice(1, -1), this.input); + termData = super.readFullTerm(this.input, termIndex); - if (termData.label.length === 0) { + if (! termData) { return; } }