N°931 Fix bug when max allowed items set to 1

This commit is contained in:
Molkobain
2018-12-14 11:11:59 +01:00
parent b4448c5bb9
commit 9b5d8b8a01
2 changed files with 8 additions and 1 deletions

View File

@@ -278,6 +278,13 @@ $.widget('itop.set_widget',
}
}
// When only one item allowed, selectize doesn't trigger the _onTagRemove callback so we have to clean ourselves.
if((this.maxItemsAllowed === 1) && (this.originalValue.length > 0)) {
if(setItemCode !== this.originalValue[0]) {
this.setItemsCodesStatus[this.originalValue[0]] = this.STATUS_REMOVED;
}
}
this.refresh();
},