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] persistent=true open=false, component visible after adding props/children that increase size

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

Expected Behavior

This issue is similar to #8963, to which I added a comment. If children are added to a drawer where persistent=true, the component will spill onto the page.

The component position should update automatically in order to stay hidden or provide the caller with the information needed to resize the component.

@oliviertassinari said: “The resolution should be about adding an action property to the Slider so people can programmatically update the position.”

Current Behavior

Currently the drawer content spills onto the page when children are added while the drawer is closed.

Steps to Reproduce (for bugs)

See a demo here:

https://codesandbox.io/s/vqvzk2zv2y

Context

I’m using a bottom anchored persistent drawer for a list of file uploads. The drawer content has a max-height, but the exact height isn’t specified. I want the drawer to be the right height to only be as large as needed to cover the list of uploaded files. Currently, as completed uploads are added to the list, if the drawer is closed, the content will spill onto the page until the drawer is opened and then closed again.

Your Environment

Tech Version
Material-UI material-ui@1.0.0-beta.31
React react@16.2.0
browser Version 64.0.3282.140 (Official Build) (64-bit)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
oleecommented, Jul 18, 2018

Instead of unmounting on exit, why not just set the subtree to display: none or something like that?

4reactions
oliviertassinaricommented, Mar 7, 2018

@freb The current behavior is a tradeoff. People can unmount the drawer from the DOM once the animation is finished:

<Drawer
  variant="persistent"
  SlideProps={{
    unmountOnExit: true
  }}

It’s solving your problem: https://codesandbox.io/s/v8592mk02l. However, users will experience a higher time to responsiveness. More work is needed by the browser when a user opens the Drawer.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Drawer] persistent=true open=false, component visible after ...
If children are added to a drawer where persistent=true, ... component visible after adding props/children that increase size #10183.
Read more >
Material-ui drawer width issue - Stack Overflow
I've changed the width of the drawer container which causes a a problem . The drawer remains a little inside the page and...
Read more >
React Drawer component - Material UI - MUI
When the drawer is outside of the page grid and opens, the drawer forces other content to change size and adapt to the...
Read more >
A Complete Guide To props.children In React - codeburst
props.children is one of React's most useful features. Learn how to use it and start harnessing the full potential of the React component...
Read more >
How to make Drawer using Material UI ? - GeeksforGeeks
Material UI Drawer is the most widely used component of Material UI. ... Persistent Drawer: This drawer is visible on the web page...
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