FIX: more resilient focus filter or header
This commit is contained in:
parent
017f5c1aee
commit
d54da517d9
|
@ -67,13 +67,14 @@ export default Ember.Mixin.create({
|
|||
|
||||
// try to focus filter and fallback to header if not present
|
||||
focusFilterOrHeader() {
|
||||
const context = this;
|
||||
// next so we are sure it finised expand/collapse
|
||||
Ember.run.next(() => {
|
||||
Ember.run.schedule("afterRender", () => {
|
||||
if (!this.$filterInput().is(":visible")) {
|
||||
this.$header().focus();
|
||||
if (!context.$filterInput() || !context.$filterInput().is(":visible")) {
|
||||
context.$header().focus();
|
||||
} else {
|
||||
this.$filterInput().focus();
|
||||
context.$filterInput().focus();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue