mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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
|
// try to focus filter and fallback to header if not present
|
||||||
focusFilterOrHeader() {
|
focusFilterOrHeader() {
|
||||||
|
const context = this;
|
||||||
// next so we are sure it finised expand/collapse
|
// next so we are sure it finised expand/collapse
|
||||||
Ember.run.next(() => {
|
Ember.run.next(() => {
|
||||||
Ember.run.schedule("afterRender", () => {
|
Ember.run.schedule("afterRender", () => {
|
||||||
if (!this.$filterInput().is(":visible")) {
|
if (!context.$filterInput() || !context.$filterInput().is(":visible")) {
|
||||||
this.$header().focus();
|
context.$header().focus();
|
||||||
} else {
|
} else {
|
||||||
this.$filterInput().focus();
|
context.$filterInput().focus();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user