From 15752da957bea1b7aee73e67429345740d29706a Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 15 Dec 2021 12:33:33 +1100 Subject: [PATCH] Revert "A11Y: Focus last viewed topic in topic lists (#15300)" (#15304) This reverts commit 76aeee6735ea06302dd9c09cf2bd2ce0e01e827e. Sadly this breaks on non-screen readers on Chrome and Safari --- .../discourse/app/components/topic-list-item.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) 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")); }); },