Skip to content

Commit dfbd4b5

Browse files
authored
fix(theme): unset overflow style when sidebar destroy (#1949)
1 parent 1ae7d7e commit dfbd4b5

File tree

1 file changed

+5
-0
lines changed
  • packages/theme-default/src/components/Sidebar

1 file changed

+5
-0
lines changed

packages/theme-default/src/components/Sidebar/index.tsx

+5
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ export function Sidebar(props: Props) {
8888
document.body.style.overflow = bodyStyleOverflow || '';
8989
}
9090
}
91+
return () => {
92+
if (inBrowser()) {
93+
document.body.style.overflow = bodyStyleOverflow || '';
94+
}
95+
};
9196
}, [isSidebarOpen]);
9297

9398
useEffect(() => {

0 commit comments

Comments
 (0)