Skip to content

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

Revert "FIX: attempts to exit lock-on early (#21949)" (#22045)

Joffrey JAFFEUX737e007f012e
diff --git a/app/assets/javascripts/discourse/app/lib/lock-on.js b/app/assets/javascripts/discourse/app/lib/lock-on.js
index 1629f9c5606..4f18588f3d6 100644
--- a/app/assets/javascripts/discourse/app/lib/lock-on.js
+++ b/app/assets/javascripts/discourse/app/lib/lock-on.js
@@ -120,11 +120,9 @@ export default class LockOn {
return this.clearLock();
}
- if (!within(4, top, this.previousTop)) {
+ if (!within(4, top, this.previousTop) || !within(4, window.scrollY, top)) {
window.scrollTo(window.pageXOffset, top);
this.previousTop = top;
- } else {
- return this.clearLock();
}
// Stop early when maintaining the original offset