Skip to content

Commit 2a03c1a

Browse files
committed
Merge pull request react-bootstrap#1463 from WChargin/patch-1
Suggest wrapping `Collapse` contents in a `div`
2 parents 58f59ac + 87ef3a2 commit 2a03c1a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docs/src/ComponentsPage.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -952,6 +952,20 @@ const ComponentsPage = React.createClass({
952952

953953
<h3><Anchor id="utilities-collapse">Collapse</Anchor></h3>
954954
<p>Add a collapse toggle animation to an element or component.</p>
955+
<div className="bs-callout bs-callout-info">
956+
<h4>Smoothing animations</h4>
957+
<p>
958+
If you're noticing choppy animations,
959+
and the component that's being collapsed
960+
has non-zero margin or padding,
961+
try wrapping the contents
962+
of your <code>&lt;Collapse&gt;</code>
963+
{" "}inside a node with no margin or padding,
964+
like the <code>&lt;div&gt;</code> in the example below.
965+
This will allow the height to be computed properly,
966+
so the animation can proceed smoothly.
967+
</p>
968+
</div>
955969
<ReactPlayground codeText={Samples.Collapse} />
956970

957971
<h4><Anchor id="utilities-collapse-props">Props</Anchor></h4>

0 commit comments

Comments
 (0)