From 59a83634c4baed505b3431ad78b35b0500999112 Mon Sep 17 00:00:00 2001 From: Penar Musaraj Date: Wed, 23 Sep 2020 10:15:58 -0400 Subject: [PATCH] FIX: Use scrollY for current scroll position This replaces an invalid `window.scrollTop` occurrence, left over from a jQuery refactoring. It should fix an undesirable "shake effect" I have run into in Safari when navigating to a reply in the post stream. --- app/assets/javascripts/discourse/app/lib/lock-on.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/assets/javascripts/discourse/app/lib/lock-on.js b/app/assets/javascripts/discourse/app/lib/lock-on.js index c0af323392c..941e7d4a986 100644 --- a/app/assets/javascripts/discourse/app/lib/lock-on.js +++ b/app/assets/javascripts/discourse/app/lib/lock-on.js @@ -113,10 +113,7 @@ export default class LockOn { return this.clearLock(); } - if ( - !within(4, top, this.previousTop) || - !within(4, window.scrollTop, top) - ) { + if (!within(4, top, this.previousTop) || !within(4, window.scrollY, top)) { window.scrollTo(window.pageXOffset, top); this.previousTop = top; }