mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: ensures minimum tags logic is correct and shared (#14723)
Also fixes a bug where select-kit was not updating noneItem in multi-selects.
This commit is contained in:
@@ -124,35 +124,40 @@ export default SelectKitComponent.extend({
|
||||
}
|
||||
},
|
||||
|
||||
selectedContent: computed("value.[]", "content.[]", function () {
|
||||
const value = makeArray(this.value).map((v) =>
|
||||
this.selectKit.options.castInteger && this._isNumeric(v) ? Number(v) : v
|
||||
);
|
||||
selectedContent: computed(
|
||||
"value.[]",
|
||||
"content.[]",
|
||||
"selectKit.noneItem",
|
||||
function () {
|
||||
const value = makeArray(this.value).map((v) =>
|
||||
this.selectKit.options.castInteger && this._isNumeric(v) ? Number(v) : v
|
||||
);
|
||||
|
||||
if (value.length) {
|
||||
let content = [];
|
||||
if (value.length) {
|
||||
let content = [];
|
||||
|
||||
value.forEach((v) => {
|
||||
if (this.selectKit.valueProperty) {
|
||||
const c = makeArray(this.content).findBy(
|
||||
this.selectKit.valueProperty,
|
||||
v
|
||||
);
|
||||
if (c) {
|
||||
content.push(c);
|
||||
value.forEach((v) => {
|
||||
if (this.selectKit.valueProperty) {
|
||||
const c = makeArray(this.content).findBy(
|
||||
this.selectKit.valueProperty,
|
||||
v
|
||||
);
|
||||
if (c) {
|
||||
content.push(c);
|
||||
}
|
||||
} else {
|
||||
if (makeArray(this.content).includes(v)) {
|
||||
content.push(v);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (makeArray(this.content).includes(v)) {
|
||||
content.push(v);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
return this.selectKit.modifySelection(content);
|
||||
return this.selectKit.modifySelection(content);
|
||||
}
|
||||
|
||||
return this.selectKit.noneItem;
|
||||
}
|
||||
|
||||
return null;
|
||||
}),
|
||||
),
|
||||
|
||||
_onKeydown(event) {
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user