nkbt / react-collapse

Component-wrapper for collapse animation with react-motion for elements with variable (and dynamic) height
MIT License
1.12k stars 113 forks source link

Add information about how to avoid margin-related jump "bug" #216

Closed kjetilsbl closed 6 years ago

kjetilsbl commented 6 years ago

Encountered the bug which causes the animation to jump because of troubles with margin calculations, and found some useful information in the README of v2:

Due to the complexity of margins and their potentially collapsible nature, ReactCollapse does not support (vertical) margins on their children. It might lead to the animation "jumping" to its correct height at the end of expanding. To avoid this, use padding instead of margin. (see #101)

Suggest bringing it back as it apparently still helps

selbekk commented 6 years ago

This won't be needed after #219 is merged, hopefully 😄