mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
FIX: allows select-kit to search by null value
This commit is contained in:
@ -94,7 +94,6 @@ export default SelectKitComponent.extend({
|
|||||||
|
|
||||||
@computed("computedValue", "computedContent.[]")
|
@computed("computedValue", "computedContent.[]")
|
||||||
selectedComputedContent(computedValue, computedContent) {
|
selectedComputedContent(computedValue, computedContent) {
|
||||||
if (isNone(computedValue) || isNone(computedContent)) { return null; }
|
|
||||||
return computedContent.findBy("value", computedValue);
|
return computedContent.findBy("value", computedValue);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -423,3 +423,20 @@ componentTest('with nameChanges', {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
componentTest('with null value', {
|
||||||
|
template: '{{single-select content=content}}',
|
||||||
|
|
||||||
|
beforeEach() {
|
||||||
|
this.set("content", [{ name: "robin" }]);
|
||||||
|
},
|
||||||
|
|
||||||
|
test(assert) {
|
||||||
|
expandSelectKit();
|
||||||
|
|
||||||
|
andThen(() => {
|
||||||
|
assert.equal(selectKit().header.name(), "robin");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Reference in New Issue
Block a user