From c82c446a973e8a5479d2e8cd68eee27195ce65ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=98=8E=E9=87=8E?= <898310895@qq.com> Date: Tue, 22 Nov 2022 05:36:17 +0800 Subject: [PATCH 1/2] Fix missing px of top style --- src/bodyScrollLock.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bodyScrollLock.js b/src/bodyScrollLock.js index cb4b1459..75319e30 100644 --- a/src/bodyScrollLock.js +++ b/src/bodyScrollLock.js @@ -127,7 +127,7 @@ const setPositionFixed = () => window.requestAnimationFrame(() => { const bottomBarHeight = innerHeight - window.innerHeight; if (bottomBarHeight && scrollY >= innerHeight) { // Move the content further up so that the bottom bar doesn't hide it - document.body.style.top = -(scrollY + bottomBarHeight); + document.body.style.top = -(scrollY + bottomBarHeight) + 'px'; } }), 300) } From 99d8b8f9fed61652f40aa504ddd1c68b3ba002b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=98=8E=E9=87=8E?= <898310895@qq.com> Date: Mon, 28 Nov 2022 23:41:56 +0800 Subject: [PATCH 2/2] Update src/bodyScrollLock.js Co-authored-by: Alex Barnsley <8069294+alexbarnsley@users.noreply.github.com> --- src/bodyScrollLock.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bodyScrollLock.js b/src/bodyScrollLock.js index 75319e30..edfcc0a0 100644 --- a/src/bodyScrollLock.js +++ b/src/bodyScrollLock.js @@ -127,7 +127,7 @@ const setPositionFixed = () => window.requestAnimationFrame(() => { const bottomBarHeight = innerHeight - window.innerHeight; if (bottomBarHeight && scrollY >= innerHeight) { // Move the content further up so that the bottom bar doesn't hide it - document.body.style.top = -(scrollY + bottomBarHeight) + 'px'; + document.body.style.top = `${-(scrollY + bottomBarHeight)}px`; } }), 300) }