-
Notifications
You must be signed in to change notification settings - Fork 113
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 "jumps" as it nears the end of an animation #101
Comments
The reason is because some of the child components most likely have margins (or some components that surround collapse). It is impossible to measure those "effects" until component is completely expanded (some margins are "squashed" or the other way doubled, depending on different conditions). I suggest to avoid using margins on components inside collapse and stick to paddings. The container itself should ideally have neither paddings nor margins (ideally). It needs some tweaking on app level. |
can't |
I believe that it is out of scope for the component. There are many edge cases that will have incorrect behaviour unfortunately. I had it done this way before and would not do it on a public library. It is way easier not to add margins/paddings to collapse element and style all the elements inside and outside of it so everything looks like expected. PS react-collapse@3 does not use react-height anymore, but still assumes its own element has no padding/margins |
Ah, collapsing margins would be a pain to calculate, I agree. Alright, this is closable then I guess - but a mention in the readme about this behavior would probably be good. I'll submit a PR |
Remove old NavBar Add SVG Nav Icons Copies of the iOS icons, run through https://jakearchibald.github.io/svgomg/ and modified to have unique IDs throughout. Add react-svg-loader Add NavTile component Add NavGrid component Convert Header to createClass, add NavGrid Make the hamburger button a <button> CSS tweaks for header Style the hamburger Add react-addons-transition-group Remove wrapper div from around NavGrid Convert NavGrid to createClass Add HeaderNavGrid component Remove react-addons-transition-group Add react-collapse and friends Swap margin for padding in HeaderNavGrid nkbt/react-collapse#101 Implement <Collapse> in Header for HeaderNavGrid
A bit late to the party, but you can work with margins if you add a clearfix to the content element like this: .ReactCollapse--content:after,
.ReactCollapse--content:before {
content: "";
display: table;
} |
Thanks @LucusWebsites for suggestion! Feel free to add it to |
My solution might not be generalisable because I had a single What I did was to add |
This seems to happen everywhere I use it..
The text was updated successfully, but these errors were encountered: