FIX: update minimum required tag when switching categories in composer
This commit is contained in:
parent
fbeaba4acf
commit
c5b1f028ed
|
@ -10,7 +10,6 @@ const SELECTED_TAGS_COLLECTION = "MINI_TAG_CHOOSER_SELECTED_TAGS";
|
|||
import { ERRORS_COLLECTION } from "select-kit/components/select-kit";
|
||||
|
||||
export default ComboBox.extend(TagsMixin, {
|
||||
headerComponent: "mini-tag-chooser/mini-tag-chooser-header",
|
||||
pluginApiIdentifiers: ["mini-tag-chooser"],
|
||||
attributeBindings: ["selectKit.options.categoryId:category-id"],
|
||||
classNames: ["mini-tag-chooser"],
|
||||
|
@ -31,6 +30,7 @@ export default ComboBox.extend(TagsMixin, {
|
|||
),
|
||||
|
||||
selectKitOptions: {
|
||||
headerComponent: "mini-tag-chooser/mini-tag-chooser-header",
|
||||
fullWidthOnMobile: true,
|
||||
filterable: true,
|
||||
caretDownIcon: "caretIcon",
|
||||
|
|
|
@ -12,31 +12,36 @@ export default SelectKitComponent.extend({
|
|||
headerComponent: "select-kit/single-select-header"
|
||||
},
|
||||
|
||||
selectedContent: computed("value", "content.[]", function() {
|
||||
if (!isEmpty(this.value)) {
|
||||
let content;
|
||||
selectedContent: computed(
|
||||
"value",
|
||||
"content.[]",
|
||||
"selectKit.noneItem",
|
||||
function() {
|
||||
if (!isEmpty(this.value)) {
|
||||
let content;
|
||||
|
||||
const value =
|
||||
this.selectKit.options.castInteger && this._isNumeric(this.value)
|
||||
? Number(this.value)
|
||||
: this.value;
|
||||
const value =
|
||||
this.selectKit.options.castInteger && this._isNumeric(this.value)
|
||||
? Number(this.value)
|
||||
: this.value;
|
||||
|
||||
if (this.selectKit.valueProperty) {
|
||||
content = (this.content || []).findBy(
|
||||
this.selectKit.valueProperty,
|
||||
value
|
||||
);
|
||||
if (this.selectKit.valueProperty) {
|
||||
content = (this.content || []).findBy(
|
||||
this.selectKit.valueProperty,
|
||||
value
|
||||
);
|
||||
|
||||
return this.selectKit.modifySelection(
|
||||
content || this.defaultItem(value, value)
|
||||
);
|
||||
return this.selectKit.modifySelection(
|
||||
content || this.defaultItem(value, value)
|
||||
);
|
||||
} else {
|
||||
return this.selectKit.modifySelection(
|
||||
(this.content || []).filter(c => c === value)
|
||||
);
|
||||
}
|
||||
} else {
|
||||
return this.selectKit.modifySelection(
|
||||
(this.content || []).filter(c => c === value)
|
||||
);
|
||||
return this.selectKit.noneItem;
|
||||
}
|
||||
} else {
|
||||
return this.selectKit.noneItem;
|
||||
}
|
||||
})
|
||||
)
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue