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) })
|
permission: PermissionType.create({ id: parseInt(id) })
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.set('selectedGroup', this.get('category.availableGroups.firstObject'));
|
||||||
},
|
},
|
||||||
|
|
||||||
removePermission(permission) {
|
removePermission(permission) {
|
||||||
|
|
|
@ -481,12 +481,13 @@ export default Ember.Component.extend(UtilsMixin, DomHelpersMixin, KeyboardMixin
|
||||||
|
|
||||||
const none = isNone(this.get("none"));
|
const none = isNone(this.get("none"));
|
||||||
const emptyValue = isEmpty(this.get("value"));
|
const emptyValue = isEmpty(this.get("value"));
|
||||||
const notEmptyContent = !isEmpty(this.get("content"));
|
|
||||||
|
|
||||||
if (none && emptyValue && notEmptyContent) {
|
if (none && emptyValue) {
|
||||||
Ember.run.scheduleOnce("sync", () => {
|
Ember.run.scheduleOnce("sync", () => {
|
||||||
const firstValue = this.get(`content.0.${this.get("valueAttribute")}`);
|
if (!isEmpty(this.get("computedContent"))) {
|
||||||
this.set("value", firstValue);
|
const firstValue = this.get("computedContent.firstObject.value");
|
||||||
|
this.set("value", firstValue);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue