From 0c05c9aaf65c838d8ac812afc0385ead09d3b5b4 Mon Sep 17 00:00:00 2001 From: developomp Date: Thu, 20 May 2021 16:26:30 +0900 Subject: [PATCH] fixed issue where the site shows scrollbar that didn't exist until when sidebar was shown and hidden --- source/src/components/Sidebar.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/source/src/components/Sidebar.tsx b/source/src/components/Sidebar.tsx index 06ce6f0..fd9229b 100644 --- a/source/src/components/Sidebar.tsx +++ b/source/src/components/Sidebar.tsx @@ -28,9 +28,7 @@ export default class Sidebar extends React.Component< // for some reason this.setState only works if this is an arrow function toggleSidebar = () => { this.setState({ isSidebarOpen: !this.state.isSidebarOpen }) - document.body.style.overflow = this.state.isSidebarOpen - ? "scroll" - : "hidden" + document.body.style.overflow = this.state.isSidebarOpen ? "" : "hidden" } CommonSidebarToggleButtonStyle = css`