# キーボードショートカットで返信間を移動するとトピックが「スタック」する

**URL:** https://meta.discourse.org/t/using-keyboard-shortcuts-to-navigate-between-replies-causes-topic-to-be-stuck/385780
**Category:** Bug
**Tags:** desktop, keyboard-shortcuts
**Created:** [2025 年 10 月 16 日午前 12:09 UTC](https://meta.discourse.org/t/using-keyboard-shortcuts-to-navigate-between-replies-causes-topic-to-be-stuck/385780 "2025-10-16T00:09:23Z")
**Posts on this page:** 1
**Showing post:** 8

<div class="post-metadata">

### Author: ![saquetim](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saquetim/32/116400_2.png) [@saquetim](https://meta.discourse.org/u/saquetim)
#### Post date: [2026 年 2 月 13 日午前 2:02 UTC](https://meta.discourse.org/t/using-keyboard-shortcuts-to-navigate-between-replies-causes-topic-to-be-stuck/385780/8 "2026-02-13T02:02:04Z")

</div>

> <https://github.com/discourse/discourse/pull/37788>
>
> \## Summary
> 
> \- Improves scroll position stability when loading posts above the vi…ewport by using \`scrollBy\`-based compensation instead of \`scrollTo\` + \`offsetCalculator\`
> \- Dynamically hides banners, notices, and footer content when the user is in the middle of a long topic via a new \`scrollState\` service and \`{{hideScrollableContent}}\` helper
> \- Triggers loading more posts when navigating to boundary posts via keyboard (\`j\`/\`k\` keys)
> \- Prevents load-more sentinel from re-triggering during scroll compensation with a \`suppressLoadAbove\` flag
> 
> \## Details
> 
> \### Scroll compensation
> 
> When new posts are prepended above the viewport, the component captures the anchor post's position via \`getBoundingClientRect()\` before DOM insertion (using a \`beforePrepend\` callback in \`prependMore()\`), then compensates with \`window.scrollBy()\` after insertion. This keeps the reading position visually stable.
> 
> \### Content hiding
> 
> A \`scrollState\` service tracks ref-counted hide requests. The \`{{hideScrollableContent}}\` class-based helper registers with the service and automatically cleans up via \`registerDestructor\`. The \`application.gjs\` and \`topic.gjs\` templates wrap scrollable content in \`{{#unless shouldHideScrollableContentAbove/Below}}\` blocks.
> 
> The helper invocations live in \`topic.gjs\` outside the \`{{#unless loadingFilter}}\` guard so content stays hidden during timeline jumps that temporarily unmount \`\<PostStream\>\`.
> 
> \### Keyboard navigation
> 
> \`updateKeyboardSelectedPostNumber\` now checks if the selected post is at a loaded boundary (\`firstAvailablePost\` / \`lastAvailablePost\`) and triggers \`loadMoreAbove\` / \`loadMoreBelow\`. Double-loading is prevented by existing \`canPrependMore\` / \`canAppendMore\` guards.

上記のプルリクエストがこの問題を解決します。

---

_[View the full topic](https://meta.discourse.org/t/using-keyboard-shortcuts-to-navigate-between-replies-causes-topic-to-be-stuck/385780)._
