Skip to content

Commit

Permalink
TermInput: Terms added by separator have correct attributes
Browse files Browse the repository at this point in the history
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
  • Loading branch information
sukhwinder33445 committed Oct 13, 2022
1 parent 2eb986b commit 0de3900
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions asset/js/widget/TermInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 0de3900

Please sign in to comment.