mirror of
https://github.com/discourse/discourse.git
synced 2025-04-03 05:39:41 +08:00
FIX: ensures selection is lookedup into async content (#7586)
This commit is contained in:
parent
631b16ef86
commit
c238f0d223
@ -198,12 +198,17 @@ export default SelectKitComponent.extend({
|
|||||||
return this._super() && !this.get("hasReachedMaximum");
|
return this._super() && !this.get("hasReachedMaximum");
|
||||||
},
|
},
|
||||||
|
|
||||||
@computed("computedValues.[]", "computedContent.[]")
|
@computed(
|
||||||
selection(computedValues, computedContent) {
|
"computedValues.[]",
|
||||||
|
"computedContent.[]",
|
||||||
|
"computedAsyncContent.[]"
|
||||||
|
)
|
||||||
|
selection(computedValues, computedContent, computedAsyncContent) {
|
||||||
const selected = [];
|
const selected = [];
|
||||||
|
const content = this.isAsync ? computedAsyncContent : computedContent;
|
||||||
|
|
||||||
computedValues.forEach(v => {
|
computedValues.forEach(v => {
|
||||||
const value = computedContent.findBy("value", v);
|
const value = content.findBy("value", v);
|
||||||
if (value) selected.push(value);
|
if (value) selected.push(value);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user