mirror of
https://github.com/discourse/discourse.git
synced 2025-04-25 14:54:31 +08:00
FIX: Do not attempt to focus topic-list-item after destroy (#22468)
Under certain conditions, this `afterRender` hook can be triggered after the topic-list-item has been removed from the DOM. This is more likely when the 'loading slider' strategy is used on a site.
This commit is contained in:
parent
250e3d881d
commit
b40347dcac
@ -63,6 +63,9 @@ export default Component.extend({
|
|||||||
htmlSafe(template(this, RUNTIME_OPTIONS))
|
htmlSafe(template(this, RUNTIME_OPTIONS))
|
||||||
);
|
);
|
||||||
schedule("afterRender", () => {
|
schedule("afterRender", () => {
|
||||||
|
if (this.isDestroyed || this.isDestroying) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (this.selected && this.selected.includes(this.topic)) {
|
if (this.selected && this.selected.includes(this.topic)) {
|
||||||
this.element.querySelector("input.bulk-select").checked = true;
|
this.element.querySelector("input.bulk-select").checked = true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user