fixed issue where the site shows scrollbar that didn't exist until when sidebar was shown and hidden

This commit is contained in:
Kim, Jimin 2021-05-20 16:26:30 +09:00
parent 61064dba15
commit 0c05c9aaf6

View file

@ -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`