Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

WiXSL
Copy link
Contributor

@WiXSL WiXSL commented May 2, 2020

Fixes #4684

Before:
before

After:
after

@@ -11,7 +11,7 @@ export const CLOSED_DRAWER_WIDTH = 55;
const useStyles = makeStyles(
theme => ({
drawerPaper: {
position: 'relative',
position: 'sticky',
Copy link
Member

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',
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
position: 'sticky',
position: 'fixed',

please take a look at this doc for explanation. https://caniuse.com/#feat=css-fixed

Copy link
Contributor Author

@WiXSL WiXSL May 5, 2020

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,

Copy link
Contributor Author

@WiXSL WiXSL May 5, 2020

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any other suggestions?

@WiXSL
Copy link
Contributor Author

WiXSL commented Nov 16, 2020

For anyone interested, I've moved to a different solution in user land:
A Datagrid with scrollable content indirectly solving the movement of the menus.

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>
    );
};

fzaninotto added a commit that referenced this pull request Aug 26, 2021
@fzaninotto fzaninotto mentioned this pull request Aug 26, 2021
9 tasks
@fzaninotto
Copy link
Member

I've begun to implement this another way in #6534, so I'll close this PR, which has gone stale.

@fzaninotto fzaninotto closed this Aug 26, 2021
@WiXSL WiXSL deleted the fix-side-menu-vertical-scroll branch August 27, 2021 01:15
fzaninotto added a commit that referenced this pull request Sep 1, 2021
ogustavo-pereira pushed a commit to ogustavo-pereira/react-admin that referenced this pull request Nov 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Side menu scroll with data
3 participants