mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 01:47:22 +08:00
FIX: makes sure the combo-box selects the first value
This commit is contained in:
parent
71cea12ee2
commit
43920827ed
|
@ -20,6 +20,8 @@ export default buildCategoryPanel('security', {
|
|||
permission: PermissionType.create({ id: parseInt(id) })
|
||||
});
|
||||
}
|
||||
|
||||
this.set('selectedGroup', this.get('category.availableGroups.firstObject'));
|
||||
},
|
||||
|
||||
removePermission(permission) {
|
||||
|
|
|
@ -481,12 +481,13 @@ export default Ember.Component.extend(UtilsMixin, DomHelpersMixin, KeyboardMixin
|
|||
|
||||
const none = isNone(this.get("none"));
|
||||
const emptyValue = isEmpty(this.get("value"));
|
||||
const notEmptyContent = !isEmpty(this.get("content"));
|
||||
|
||||
if (none && emptyValue && notEmptyContent) {
|
||||
if (none && emptyValue) {
|
||||
Ember.run.scheduleOnce("sync", () => {
|
||||
const firstValue = this.get(`content.0.${this.get("valueAttribute")}`);
|
||||
this.set("value", firstValue);
|
||||
if (!isEmpty(this.get("computedContent"))) {
|
||||
const firstValue = this.get("computedContent.firstObject.value");
|
||||
this.set("value", firstValue);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user