FIX: fires onExpand/onCollapse when using arrows

This commit is contained in:
Joffrey JAFFEUX 2018-03-22 18:35:46 +01:00 committed by GitHub
parent 841e2ba723
commit cbbeedf53b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -359,10 +359,8 @@ export default Ember.Component.extend(UtilsMixin, PluginApiMixin, DomHelpersMixi
this.clearHighlightSelection();
if (this.get("isExpanded")) {
this._boundaryActionHandler("onCollapse", this);
this.collapse();
} else {
this._boundaryActionHandler("onExpand", this);
this.expand();
}
},

View File

@ -84,11 +84,13 @@ export default Ember.Mixin.create({
this.setProperties({ isExpanded: true, renderedBodyOnce: true, isFocused: true });
this.focusFilterOrHeader();
this.autoHighlight();
this._boundaryActionHandler("onExpand", this);
},
collapse() {
this.set("isExpanded", false);
Ember.run.schedule("afterRender", () => this._removeFixedPosition() );
this._boundaryActionHandler("onCollapse", this);
},
// lose focus of the component in two steps

View File

@ -193,9 +193,7 @@ export default Ember.Mixin.create({
const keyCode = event.keyCode || event.which;
const $rows = this.$rows();
if (this.get("isExpanded") === false) {
if (!this.get("isExpanded")) {
this.expand(event);
if (this.$selectedRow().length === 1) {
@ -206,6 +204,8 @@ export default Ember.Mixin.create({
return;
}
const $rows = this.$rows();
if (!$rows.length) { return; }
if ($rows.length === 1) {