From 8a5f1469a809d268700213763ce02fb5611eb37c Mon Sep 17 00:00:00 2001 From: Mike Kazmier Date: Mon, 7 Jan 2019 14:02:38 -0700 Subject: [PATCH 1/3] only use a fixed/calculated hieght during animation --- Collapsible.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Collapsible.js b/Collapsible.js index 92ff103..2ecb2e6 100644 --- a/Collapsible.js +++ b/Collapsible.js @@ -182,7 +182,7 @@ export default class Collapsible extends Component { const { collapsed, enablePointerEvents } = this.props; const { height, contentHeight, measuring, measured } = this.state; const hasKnownHeight = !measuring && (measured || collapsed); - const style = hasKnownHeight && { + const style = hasKnownHeight && animating && { overflow: 'hidden', height: height, }; From 67171d8ef5f147302bc941f24b305b2e6df09dcb Mon Sep 17 00:00:00 2001 From: Mike Kazmier Date: Mon, 7 Jan 2019 15:09:20 -0700 Subject: [PATCH 2/3] destructure animating from state --- Collapsible.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Collapsible.js b/Collapsible.js index 2ecb2e6..8f7323c 100644 --- a/Collapsible.js +++ b/Collapsible.js @@ -180,7 +180,13 @@ export default class Collapsible extends Component { render() { const { collapsed, enablePointerEvents } = this.props; - const { height, contentHeight, measuring, measured } = this.state; + const { + animating, + height, + contentHeight, + measuring, + measured + } = this.state; const hasKnownHeight = !measuring && (measured || collapsed); const style = hasKnownHeight && animating && { overflow: 'hidden', From 8ff6fb5d1a0ad9b0c43fcf0ee6ebf30c41b44da3 Mon Sep 17 00:00:00 2001 From: Mike Kazmier Date: Mon, 7 Jan 2019 15:18:23 -0700 Subject: [PATCH 3/3] prettier round 2 --- Collapsible.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Collapsible.js b/Collapsible.js index 8f7323c..0bf3b77 100644 --- a/Collapsible.js +++ b/Collapsible.js @@ -180,18 +180,19 @@ export default class Collapsible extends Component { render() { const { collapsed, enablePointerEvents } = this.props; - const { + const { animating, - height, - contentHeight, - measuring, - measured + height, + contentHeight, + measuring, + measured, } = this.state; const hasKnownHeight = !measuring && (measured || collapsed); - const style = hasKnownHeight && animating && { - overflow: 'hidden', - height: height, - }; + const style = hasKnownHeight && + animating && { + overflow: 'hidden', + height: height, + }; const contentStyle = {}; if (measuring) { contentStyle.position = 'absolute';