Allow placeholder to be configured for combo-box.

This commit is contained in:
Guo Xiang Tan
2018-03-29 10:25:29 +08:00
parent a64cc9a990
commit 27f06505b1
4 changed files with 17 additions and 4 deletions

View File

@@ -24,8 +24,11 @@ export default SingleSelectComponent.extend({
@on("didReceiveAttrs")
_setComboBoxOptions() {
const placeholder = this.get('placeholder');
this.get("headerComponentOptions").setProperties({
clearable: this.get("clearable"),
placeholder: placeholder ? I18n.t(placeholder) : "",
});
}
});

View File

@@ -7,5 +7,6 @@ export default SelectKitHeaderComponent.extend({
clearable: Ember.computed.alias("options.clearable"),
caretUpIcon: Ember.computed.alias("options.caretUpIcon"),
caretDownIcon: Ember.computed.alias("options.caretDownIcon"),
shouldDisplayClearableButton: Ember.computed.and("clearable", "computedContent.hasSelection")
shouldDisplayClearableButton: Ember.computed.and("clearable", "computedContent.hasSelection"),
placeholder: Ember.computed.alias("options.placeholder"),
});