-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Fix Sidebar scrolling with Admin content #4753
Conversation
@@ -11,7 +11,7 @@ export const CLOSED_DRAWER_WIDTH = 55; | |||
const useStyles = makeStyles( | |||
theme => ({ | |||
drawerPaper: { | |||
position: 'relative', | |||
position: 'sticky', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this completely breaks the layout on iE11 (which is otherwise pretty well supported)
@@ -11,7 +11,7 @@ export const CLOSED_DRAWER_WIDTH = 55; | |||
const useStyles = makeStyles( | |||
theme => ({ | |||
drawerPaper: { | |||
position: 'relative', | |||
position: 'sticky', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
position: 'sticky', | |
position: 'fixed', |
please take a look at this doc for explanation. https://caniuse.com/#feat=css-fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked at your PR. and try to add
position: 'fixed'
but it breaks the layout.
Also breaks the layout:
position: 'fixed',
top: '4em',
zIndex: 100,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works in the demo because you have a surrounding div, but not when changing the same in the Sidebar's Drawer component
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any other suggestions?
For anyone interested, I've moved to a different solution in user land: import * as React from "react";
import { makeStyles } from "@material-ui/core/styles";
import TableContainer from "@material-ui/core/TableContainer";
import { Datagrid } from "react-admin";
const useStyles = makeStyles(
theme => ({
container: {
maxHeight: "70vh"
}
})
);
export const ScrollDatagrid = props => {
const classes = useStyles(props);
return (
<TableContainer className={classes.container}>
<Datagrid
stickyHeader /* <= Incompatible with IE 11 */
{...props}
/>
</TableContainer>
);
}; |
I've begun to implement this another way in #6534, so I'll close this PR, which has gone stale. |
Closes marmelab#4684 Supersedes marmelab#4753
Fixes #4684
Before:
After: