mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 02:19:27 +08:00
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");
|
||||
});
|
||||
if (opts.isLastViewedTopic && this._shouldFocusLastVisited()) {
|
||||
this._titleElement().focus();
|
||||
this._titleElement()?.focus();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user