FIX: force focus input only on expand

This commit is contained in:
Joffrey JAFFEUX 2017-11-21 18:23:49 +01:00 committed by GitHub
parent 628275fc31
commit 7669146897
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 5 deletions

View File

@ -63,6 +63,13 @@ export default Ember.Mixin.create({
// force the component in a known default state
focus() {
Ember.run.schedule("afterRender", () => this.$header().focus());
},
expand() {
if (this.get("isExpanded") === true) return;
this.setProperties({ isExpanded: true, renderedBodyOnce: true, isFocused: true });
Ember.run.schedule("afterRender", () => {
if (this.$filterInput().is(":visible")) {
this.$filterInput().focus();
@ -70,12 +77,7 @@ export default Ember.Mixin.create({
this.$header().focus();
}
});
},
expand(event) {
if (this.get("isExpanded") === true) return;
this.setProperties({ isExpanded: true, renderedBodyOnce: true, isFocused: true });
this.focus(event);
this.autoHighlight();
},