question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Drawer] variant="permanent" elevation forced to 0

See original GitHub issue

Just transferred over our drawer component to material-ui v1 and am having trouble getting the drawer to have a shadow using the “elevation” property. Is it possible to get a shadow with a drawer easily? Should the “elevation” property lead to a shadow?

  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

Current Behavior

Tuning the elevation of the drawer (as documented here doesn’t seem to affect the elevation of the drawer. image

Steps to Reproduce (for bugs)

sample code (using Typescript) Full code: https://github.com/bayesimpact/encompass/pull/666

let drawers = {
  '/analytics': AnalyticsDrawer,
  '/datasets': DatasetsDrawer,
  '/add-data': AddDatasetDrawer
}

export let LeftPane = withStore('route')(({ store }) =>
  <React.Fragment>
    {map(drawers, (Component, route) =>
      <Drawer className='LeftPaneContent' elevation={100} key={route} open={route === store.get('route')}>
        <Component />
      </Drawer>
    )}
  </React.Fragment>
)
LeftPane.displayName = 'LeftPane'

Context

Interested in having a shadow on this drawer component

Your Environment

Using Typescript.

Tech Version
Material-UI 1.0.0-beta.38
React ^16.1.1
browser
etc

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

5reactions
oliviertassinaricommented, Jun 16, 2021

You can work around the issue with

      <Drawer PaperProps={{ elevation: 5 }} variant="permanent">
        {sideList("left")}
      </Drawer>

https://codesandbox.io/s/permanent-drawer-elevation-not-visible-forked-wqhdk?file=/demo.js:1660-1767

We could still move forward with https://github.com/mui-org/material-ui/issues/10975#issuecomment-379847645, but it might not be important enough to justify spending time on it.

1reaction
mbrookescommented, Jun 16, 2021

@akegan It might also be because your elevation is out of range (> 24). You should see a warning in the console.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Drawer] variant="permanent" elevation forced to 0 #10975
Just transferred over our drawer component to material-ui v1 and am having trouble getting the drawer to have a shadow using the "elevation" ......
Read more >
Can the Drawer be permanent and lay over the content?
If you set the content's styling like this, it's position will not be effected by the drawer's state as you set its position...
Read more >
React Drawer component - Material UI - MUI
Responsive drawer​​ You can use the temporary variant to display a drawer for small screens and permanent for a drawer for wider screens....
Read more >
Material UI Course #4 | Drawer - YouTube
Yo in this video we'll learn how to setup and use the Drawer component in Material UI. hope ya enjoy :DChapters: 0 :00...
Read more >
React MUI Drawer API - GeeksforGeeks
elevation : It gives the elevation of the drawer or the height to which the drawer is elevated. The default value is 16....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found