From fccea836d3fff88a8a155485b368461c9af38e62 Mon Sep 17 00:00:00 2001 From: Matthew Grove Date: Wed, 1 Sep 2021 21:00:38 +0100 Subject: [PATCH] Fix container bottom margin setting on load Ensure page container bottom margin is set correctly when cookie notice appears --- src/App.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/App.js b/src/App.js index 8724b83..2de2b9a 100644 --- a/src/App.js +++ b/src/App.js @@ -106,10 +106,11 @@ class App extends React.Component { this.cookies = new Cookies(); this.cookieNotice = document.getElementById("cookie-notice"); this.root = document.getElementById("root"); - this.cookieNoticeHeight = this.cookieNotice.offsetHeight; + this.cookieNoticeHeight = 0; if (this.cookies.get("parandum-cookies-accepted") !== "true") { this.cookieNotice.style.display = "flex"; + this.cookieNoticeHeight = this.cookieNotice.offsetHeight; this.cookieNotice.animate({ bottom: [`-${this.cookieNoticeHeight}px`, "0px"], }, {