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

This reverts commit ad0a8cccc8.
This commit is contained in:
Joffrey JAFFEUX 2023-06-09 20:06:34 +02:00 committed by GitHub
parent 99f0ace229
commit 737e007f01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -120,11 +120,9 @@ export default class LockOn {
return this.clearLock(); 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); window.scrollTo(window.pageXOffset, top);
this.previousTop = top; this.previousTop = top;
} else {
return this.clearLock();
} }
// Stop early when maintaining the original offset // Stop early when maintaining the original offset