# 게시물이 잘못된 글로 이동합니다

**URL:** https://meta.discourse.org/t/topics-jumping-to-wrong-post/276305
**Category:** Bug
**Created:** [8월 23, 2023, 2:24오후 UTC](https://meta.discourse.org/t/topics-jumping-to-wrong-post/276305 "2023-08-23T14:24:40Z")
**Posts on this page:** 1
**Showing post:** 31

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [8월 28, 2023, 11:11오전 UTC](https://meta.discourse.org/t/topics-jumping-to-wrong-post/276305/31 "2023-08-28T11:11:16Z")

</div>

명확한 재현 단계를 알려주셔서 감사합니다 @Don 🙏

> [@sam](#):
>
> 로딩 슬라이더가 lock on과 충돌하고 있습니다

네, 맞습니다! 여기서는 두 가지 일이 동시에 일어나고 있습니다.

1. 로딩 슬라이더 서비스가 body에서 `still-loading` 클래스를 제거해야 합니다.
2. LockOn이 올바른 위치로 스크롤해야 합니다.

이 두 가지는 모두 Ember의 runloop에서 `afterRender` 부분에 예약되어 있었습니다. 그리고 ‘lock on’ 관련 작업이 기술적으로 먼저 예약되었기 때문에 먼저 실행되었습니다. 따라서 LockOn은 모든 게시글 HTML이 DOM에 있는 상태에서 실행되었지만, 여전히 `display: none` 상태였습니다. 😬

이 PR은 `still-loading` 클래스 제거를 runloop의 ‘render’ 부분으로 이동시킵니다. 이는 `afterRender`에서 작업을 예약하는 다른 모든 작업이 모든 것이 렌더링되고 **가시화** 된 후에 실행됨을 의미합니다:

> <https://github.com/discourse/discourse/pull/23290>
>
> When the 'loading slider' navigation indicator is enabled, and a connection is v…ery slow, we \`display: none\` most of the page and display a spinner. The \`still-loading\` body class for this was being added in the \`afterRender\` step in the Ember runloop. This meant that, depending on the order they were scheduled, other \`afterRender\` jobs may run before it. This caused an issue with topic scroll locations because we would attempt to scroll to an element which was \`display: none\` at the point its position was calculated.
> 
> This commit moves the \`still-loading\` class manipulations to the \`render\` step of the runloop, which is technically more correct, and means that anything scheduled in the \`afterRender\` step is guaranteed to run without the \`display: none\` CSS.
> 
> https://meta.discourse.org/t/276305/29

> [@sam](#):
>
> LockOn 클래스 전체가 약간 해킹(hack)에 가깝습니다

동의합니다! 이 버그 수정의 일부로 건드리고 싶지는 않았지만, 우리는 이러한 해킹(hack)들을 모두 제거하는 것을 목표로 해야 한다고 생각합니다.

파일 내의 주석들을 읽어보면, 원래 10년 전에 브라우저의 ‘스크롤 복원’ 기능을 상쇄하기 위해 도입된 것으로 보입니다. 요즘은 [브라우저 기능을 비활성화하기 위해 `history.scrollRestoration = false`를 사용](https://developer.mozilla.org/en-US/docs/Web/API/History/scrollRestoration)하므로, 대부분의 오래된 해킹(hack)은 불필요해졌다고 생각합니다.

아마도 이러한 민감한 변경 사항은 먼저 테마 컴포넌트를 통해 시험해 보고, 모든 것이 잘 작동하는지 확인한 후 코어에 병합하는 것이 가장 좋을 것입니다. `LockOn`을 제거하면 주제 스크롤 위치와 관련된 다른 많은 엣지 케이스도 해결될 것으로 예상됩니다. 향후 몇 주 내에 이를 시도해 볼 계획입니다 🧑‍💻

---

_[View the full topic](https://meta.discourse.org/t/topics-jumping-to-wrong-post/276305)._
