Skip to content

A platform for community discussion. Free, open, simple.

Revert "A11Y: Focus last viewed topic in topic lists (#15300)" (#15304)

Sam15752da957be
diff --git a/app/assets/javascripts/discourse/app/components/topic-list-item.js b/app/assets/javascripts/discourse/app/components/topic-list-item.js
index f545609487d..0fcbbd38f1d 100644
--- a/app/assets/javascripts/discourse/app/components/topic-list-item.js
+++ b/app/assets/javascripts/discourse/app/components/topic-list-item.js
@@ -245,16 +245,12 @@ export default Component.extend({
return;
}
- this.element.classList.add("highlighted");
- this.element.setAttribute(
- "data-islastviewedtopic",
- opts.isLastViewedTopic
- );
- this.element.querySelector(".main-link .title").focus();
+ const $topic = $(this.element);
+ $topic
+ .addClass("highlighted")
+ .attr("data-islastviewedtopic", opts.isLastViewedTopic);
- this.element.addEventListener("animationend", () => {
- this.element.classList.remove("highlighted");
- });
+ $topic.on("animationend", () => $topic.removeClass("highlighted"));
});
},