-
-
Notifications
You must be signed in to change notification settings - Fork 32.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
Collapse component doesn't wrap Grid items correctly #21971
Labels
component: Collapse
The React component
Comments
zachsa
added
the
status: waiting for maintainer
These issues haven't been looked at yet by a maintainer
label
Jul 28, 2020
1 task
I opened this issue as a response to a pull request that added the Collapse functionality, but that code is where I think there is a bug (#20619) |
Can you provide a simple reproduction example in codesandbox? |
zachsa
changed the title
Collapse component can't wrap Grid items correctly
Collapse component doesn't wrap Grid items correctly
Jul 28, 2020
I think that we can close, the Grid item should be a direct descendant of the Grid container. |
@oliviertassinari, I see that. why does this work with the |
Because it uses different css properties. See also that te transition
behaves differently in both cases.
wt., 28 lip 2020, 16:27 użytkownik Zach Smith <notifications@github.com>
napisał:
… @oliviertassinari <https://github.com/oliviertassinari>, I see that. why
does this work with the Slide component?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#21971 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACX2GNIRTOGVFQL6RYIB6SDR53N3ZANCNFSM4PKGRSOQ>
.
|
oliviertassinari
added
component: Collapse
The React component
and removed
status: waiting for maintainer
These issues haven't been looked at yet by a maintainer
labels
Jul 28, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using the
<Collapse />
component in@material-ui/core@5.0.0-alpha.3
, I think there is a bug with the recently addedorientation="horizontal"
improvements.Comparing the DOM via developer tool inspection of
Collapse
code vsSlide
code, I see that theSlide
component getsclassNames
from children (I think), whereas theCollapse
does not.Current Behavior 😯
The
<Collapse />
component takes up the whole horizontal space with this structure:In this case the
Collapse
component, whenin = true
, renders as 100% the width of the<Grid container>
. I'm not actually sure that I'm usingGrid
correctly... But when I use any other Transition this is NOT the case. For example, replacingCollapse
withThen the layout behaves correctly (in that the slide component renders 'transparently', with the child Grid component sizing working as expected).
Looking at the HTML.
The
Slide
component gets classNames associated with the Grid (which I assume is the children?):Whereas with the
Collapse
component, unlike with the Slide, no inline styles are giving, and the classes don't include any classes from the children:Is this intended?
Expected Behavior 🤔
Rewriting my JSX:
This somewhat achieves what I'm looking for but in a very jumpy, unsatisfactory way (the timout={3000} allows me to see where the problems are).
I apologize if I'm misusing the Transition component in this case! If so, I would be super grateful for pointers in the correct direction.
Context 🔦
I would like to be able to collapse a side panel in and out (on this page - https://atlas.saeon.ac.za/catalogue?terms=%2520SARVA. The filter icon in the right of the results header toggles the sidebar, but without an animation at the moment).
The structure of the page is a grid container with 2 grid items. On small screens the items are xs=12, and on larger screens the items are xs=4, and xs=8. I would like to wrap the xs=4 grid item in a collapse transition, but that is not working at the moment.
The text was updated successfully, but these errors were encountered: