Skip to content

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

FIX: full post jump not working (#25734)

Sam9372404a31fd
diff --git a/app/assets/javascripts/discourse/app/lib/keyboard-shortcuts.js b/app/assets/javascripts/discourse/app/lib/keyboard-shortcuts.js
index 22dc109d1f9..cf421dce690 100644
--- a/app/assets/javascripts/discourse/app/lib/keyboard-shortcuts.js
+++ b/app/assets/javascripts/discourse/app/lib/keyboard-shortcuts.js
@@ -832,17 +832,18 @@ export default {
},
_changeSection(direction) {
- const sections = Array.from(document.querySelectorAll(".nav.nav-pills li"));
- const active = document.querySelector(".nav.nav-pills li.active");
- const index = sections.indexOf(active) + direction;
-
- if (index >= 0 && index < sections.length) {
- sections[index].querySelector("a")?.click();
- }
-
- if (sections.length === 0) {
- // use for in post navigation
+ if (document.querySelector(".post-stream")) {
this._moveSelection({ direction, scrollWithinPosts: false });
+ } else {
+ const sections = Array.from(
+ document.querySelectorAll(".nav.nav-pills li")
+ );
+ const active = document.querySelector(".nav.nav-pills li.active");
+ const index = sections.indexOf(active) + direction;
+
+ if (index >= 0 && index < sections.length) {
+ sections[index].querySelector("a, button")?.click();
+ }
}
},