Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions UNRELEASED.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Use [the changelog guidelines](https://git.io/polaris-changelog-guidelines) to f
- Fixed `recolor-icon` Sass mixin to properly scope `$secondary-color` to the child `svg` ([#2298](https://github.com/Shopify/polaris-react/pull/2298))
- Fixed a regression with the positioning of the `Popover` component ([#2305](https://github.com/Shopify/polaris-react/pull/2305))
- Fixed Stack Item proportion when shrinking ([#2319](https://github.com/Shopify/polaris-react/pull/2319))
- Fixed animation of `Collapsible` with children having margins ([#1980](https://github.com/Shopify/polaris-react/pull/1980))

### Documentation

Expand Down
6 changes: 3 additions & 3 deletions src/components/Collapsible/Collapsible.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

.Collapsible {
overflow: hidden;
height: 0;
max-height: 0;
padding-top: 0;
padding-bottom: 0;
opacity: 0;
will-change: opacity, height;
will-change: opacity, max-height;
}

.animating {
transition-property: opacity, height;
transition-property: opacity, max-height;
transition-duration: duration(slow);
transition-timing-function: easing(out);
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/Collapsible/Collapsible.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class Collapsible extends React.Component<CollapsibleProps, State> {
<div
id={id}
aria-hidden={!open}
style={{height: displayHeight}}
style={{maxHeight: displayHeight}}
className={wrapperClassName}
ref={this.node}
onTransitionEnd={this.handleTransitionEnd}
Expand All @@ -155,11 +155,11 @@ function collapsibleHeight(
height?: number | null,
) {
if (animationState === 'idle' && open) {
return open ? 'auto' : undefined;
return open ? 'none' : undefined;
}

if (animationState === 'measuring') {
return open ? undefined : 'auto';
return open ? undefined : 'none';
}

return `${height || 0}px`;
Expand Down