-
-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Horizontal scrollbar when sidebar is collapsed #868
Comments
@siriwatknp Can I pick up this up as my first issue? |
@Technologeek thanks, you might want to look at |
Cheers! Will create a PR soon! |
@siriwatknp and @Technologeek |
@siriwatknp and @Technologeek |
A quick solution is to make the collapsed width a little bigger. For example using 74px instead of 64 solved the issue.
|
There are 2 horizontal scrollbars, here are my workarounds:
import clsx from 'clsx';
const useStyles = makeStyles((theme) => ({
sidebarOverflowFix: {
overflowX: 'hidden !important',
overflowY: 'auto !important',
},
}));
...
{({ state: { sidebar } }) => {
return (
...
<DrawerSidebar sidebarId="left_sidebar">
<SidebarContent className={clsx(sidebar.left_sidebar.collapsed && classes.sidebarOverflowFix)}>
<AppSidebar collapsed={sidebar.left_sidebar.collapsed} />
</SidebarContent>
<CollapseBtn>
{({ collapsed, anchor }) =>
collapsed ? <ArrowForwardIcon /> : <ArrowBackIcon />
}
</CollapseBtn>
</DrawerSidebar>
...
);
}}
... |
Can i pick this issue? |
@siriwatknp I'm using version 4.4.1 of mui-treasury/layout and I noticed that when the sidebar is collapsed (only icons are visible) then it is scrollable horizontally (in Windows you get the annoying scrollbar). This is due to the overflow property set to auto.
Version 3 of mui-treasury/layout doesn't have this bug, since overflow css property is set differently:
Many thanks.
Mauro
The text was updated successfully, but these errors were encountered: