FIX: select-kit perf and positioning improvements (#7093)
This commit is contained in:
parent
dc4001370c
commit
2e881adb6e
|
@ -331,20 +331,31 @@ export default SelectKitComponent.extend({
|
||||||
|
|
||||||
deselect(rowComputedContentItems) {
|
deselect(rowComputedContentItems) {
|
||||||
this.willDeselect(rowComputedContentItems);
|
this.willDeselect(rowComputedContentItems);
|
||||||
|
|
||||||
rowComputedContentItems = makeArray(rowComputedContentItems);
|
rowComputedContentItems = makeArray(rowComputedContentItems);
|
||||||
const generatedComputedContents = this._filterRemovableComputedContents(
|
const generatedComputedContents = this._filterRemovableComputedContents(
|
||||||
makeArray(rowComputedContentItems)
|
makeArray(rowComputedContentItems)
|
||||||
);
|
);
|
||||||
this.set("highlighted", null);
|
this.setProperties({ highlighted: null, highlightedSelection: [] });
|
||||||
this.set("highlightedSelection", []);
|
|
||||||
this.get("computedValues").removeObjects(
|
this.get("computedValues").removeObjects(
|
||||||
rowComputedContentItems.map(r => r.value)
|
rowComputedContentItems.map(r => r.value)
|
||||||
);
|
);
|
||||||
this.get("computedContent").removeObjects(generatedComputedContents);
|
this.get("computedContent").removeObjects([
|
||||||
run.next(() => this.mutateAttributes());
|
...rowComputedContentItems,
|
||||||
run.schedule("afterRender", () => {
|
...generatedComputedContents
|
||||||
this.didDeselect(rowComputedContentItems);
|
]);
|
||||||
this.autoHighlight();
|
|
||||||
|
run.next(() => {
|
||||||
|
this.mutateAttributes();
|
||||||
|
|
||||||
|
run.schedule("afterRender", () => {
|
||||||
|
this.didDeselect(rowComputedContentItems);
|
||||||
|
this.autoHighlight();
|
||||||
|
|
||||||
|
if (!this.isDestroying && !this.isDestroyed) {
|
||||||
|
this._positionWrapper();
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -116,6 +116,7 @@ export default Ember.Mixin.create({
|
||||||
|
|
||||||
expand() {
|
expand() {
|
||||||
if (this.get("isExpanded")) return;
|
if (this.get("isExpanded")) return;
|
||||||
|
|
||||||
this.setProperties({
|
this.setProperties({
|
||||||
isExpanded: true,
|
isExpanded: true,
|
||||||
renderedBodyOnce: true,
|
renderedBodyOnce: true,
|
||||||
|
@ -135,6 +136,8 @@ export default Ember.Mixin.create({
|
||||||
},
|
},
|
||||||
|
|
||||||
collapse() {
|
collapse() {
|
||||||
|
if (!this.get("isExpanded")) return;
|
||||||
|
|
||||||
this.set("isExpanded", false);
|
this.set("isExpanded", false);
|
||||||
|
|
||||||
Ember.run.next(() => {
|
Ember.run.next(() => {
|
||||||
|
|
Loading…
Reference in New Issue