FIX: optimize collapse/expand select-kit codepath (#6818)
This commit is contained in:
parent
1d62d3df6f
commit
942114b34c
|
@ -63,11 +63,6 @@ export default Ember.Mixin.create({
|
||||||
return this.$(this.filterInputSelector);
|
return this.$(this.filterInputSelector);
|
||||||
},
|
},
|
||||||
|
|
||||||
@on("didRender")
|
|
||||||
_schedulePositionRendering() {
|
|
||||||
Ember.run.debounce(this, this._adjustPosition, 50, true);
|
|
||||||
},
|
|
||||||
|
|
||||||
_adjustPosition() {
|
_adjustPosition() {
|
||||||
this._applyDirection();
|
this._applyDirection();
|
||||||
this._applyFixedPosition();
|
this._applyFixedPosition();
|
||||||
|
@ -128,15 +123,27 @@ export default Ember.Mixin.create({
|
||||||
});
|
});
|
||||||
this.focusFilterOrHeader();
|
this.focusFilterOrHeader();
|
||||||
this.autoHighlight();
|
this.autoHighlight();
|
||||||
this._boundaryActionHandler("onExpand", this);
|
|
||||||
|
Ember.run.next(() => {
|
||||||
|
this._boundaryActionHandler("onExpand", this);
|
||||||
|
Ember.run.schedule("afterRender", () => {
|
||||||
|
if (!this.isDestroying && !this.isDestroyed) {
|
||||||
|
this._adjustPosition();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
collapse() {
|
collapse() {
|
||||||
this.set("isExpanded", false);
|
this.set("isExpanded", false);
|
||||||
|
|
||||||
Ember.run.next(() => {
|
Ember.run.next(() => {
|
||||||
Ember.run.schedule("afterRender", () => this._removeFixedPosition());
|
|
||||||
this._boundaryActionHandler("onCollapse", this);
|
this._boundaryActionHandler("onCollapse", this);
|
||||||
|
Ember.run.schedule("afterRender", () => {
|
||||||
|
if (!this.isDestroying && !this.isDestroyed) {
|
||||||
|
this._removeFixedPosition();
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,8 @@
|
||||||
z-index: z("dropdown");
|
z-index: z("dropdown");
|
||||||
|
|
||||||
.select-kit-body {
|
.select-kit-body {
|
||||||
|
-webkit-animation: fadein 0.25s;
|
||||||
|
animation: fadein 0.25s;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
|
Loading…
Reference in New Issue