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

[Drawer] persistent=true open=false, component visible after adding props/children that increase size #10183

Closed
1 task done
freb opened this issue Feb 5, 2018 · 5 comments
Labels
component: drawer This is the name of the generic UI component, not the React module! component: transitions This is the name of the generic UI component, not the React module! discussion new feature New feature or request

Comments

@freb
Copy link

freb commented Feb 5, 2018

  • 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 [email protected]
React [email protected]
browser Version 64.0.3282.140 (Official Build) (64-bit)
@oliviertassinari
Copy link
Member

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

Yes, I was referring to this pattern for the Slide component:
https://github.com/mui-org/material-ui/blob/2f99330ce6a38c34da33bd0f1882bb6e8800f84b/src/Tabs/Tabs.js#L368-L376

@oliviertassinari oliviertassinari added this to the post v1 milestone Feb 11, 2018
@oliviertassinari oliviertassinari added the good first issue Great for first contributions. Enable to learn the contribution process. label Feb 11, 2018
@oliviertassinari
Copy link
Member

oliviertassinari commented 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.

@rolandjitsu
Copy link
Contributor

rolandjitsu commented Mar 8, 2018

@oliviertassinari note that tabbing through the page and focusing on an element inside the drawer will bring the drawer into view (if it was closed to begin with). I'm not sure if that's expected or not, but it's definitely a bit off as it's hard to close it afterwards.

I've tried with x266ry1rvw, not sure if it's the same for this issue's case.

@oliviertassinari oliviertassinari added the component: drawer This is the name of the generic UI component, not the React module! label Mar 8, 2018
@oliviertassinari oliviertassinari removed this from the post v1.0.0 milestone Jul 17, 2018
@olee
Copy link
Contributor

olee commented Jul 18, 2018

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

@IssueHuntBot
Copy link

@issuehuntfest has funded $20.00 to this issue. See it on IssueHunt

@joshwooding joshwooding added the hacktoberfest https://hacktoberfest.digitalocean.com/ label Sep 30, 2019
@joshwooding joshwooding removed the hacktoberfest https://hacktoberfest.digitalocean.com/ label Nov 3, 2019
@oliviertassinari oliviertassinari added discussion and removed good first issue Great for first contributions. Enable to learn the contribution process. labels Nov 30, 2019
@oliviertassinari oliviertassinari added component: transitions This is the name of the generic UI component, not the React module! and removed component: Slide labels Mar 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: drawer This is the name of the generic UI component, not the React module! component: transitions This is the name of the generic UI component, not the React module! discussion new feature New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants