FIX: Don't attempt to focus .title in topic-list-item if it doesn't exist (#16274)
Follow-up to 97e7bb1ce4
Themes/plugins may override the default `topic-list-item` and remove the `.main-link` or `.title` elements from the template. We shouldn't attempt to focus them if they don't exist.
This commit is contained in:
parent
817035b557
commit
8dd6cb14ee
|
@ -285,7 +285,7 @@ export default Component.extend({
|
||||||
this.element.classList.remove("highlighted");
|
this.element.classList.remove("highlighted");
|
||||||
});
|
});
|
||||||
if (opts.isLastViewedTopic && this._shouldFocusLastVisited()) {
|
if (opts.isLastViewedTopic && this._shouldFocusLastVisited()) {
|
||||||
this._titleElement().focus();
|
this._titleElement()?.focus();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue