From 6b0b0dd263e4b7ce240bf4053fb5fb11d30e98fc Mon Sep 17 00:00:00 2001 From: Tom Byers Date: Thu, 15 Aug 2019 12:23:21 +0100 Subject: [PATCH] Change method of getting scrollTop The current method reports `0` in Safari, whatever the scroll position. Some testing across our browser matrix shows: 1. this is also the case on IOS 2. browsers in the matrix all support `$(window).scrollTop()` https://scroll-position-test-page.glitch.me/#results This changes the method to use `$(window).scrollTop()` instead. --- app/assets/javascripts/fullscreenTable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/fullscreenTable.js b/app/assets/javascripts/fullscreenTable.js index 5f3cd073a..99bfc7313 100644 --- a/app/assets/javascripts/fullscreenTable.js +++ b/app/assets/javascripts/fullscreenTable.js @@ -65,7 +65,7 @@ this.maintainHeight = () => { let height = Math.min( - $(window).height() - this.topOffset + $('html, body').scrollTop(), + $(window).height() - this.topOffset + $(window).scrollTop(), this.nativeHeight );