summaryrefslogtreecommitdiffhomepage
path: root/gui
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2021-11-20 11:07:28 +0100
committerOskar Nyberg <oskar@mullvad.net>2021-11-23 15:38:23 +0100
commit78a44ff427c5277b13ec2c19171dc4d20ccbca0e (patch)
tree3d59bcae158b3bb8431c9a38e8398f3d656e3a45 /gui
parent3a78f67b38eaedcaee223dbd2f24eaec986e69b2 (diff)
downloadmullvadvpn-78a44ff427c5277b13ec2c19171dc4d20ccbca0e.tar.xz
mullvadvpn-78a44ff427c5277b13ec2c19171dc4d20ccbca0e.zip
Make sure accordion onTransitionEnd is from correct transition
Diffstat (limited to 'gui')
-rw-r--r--gui/src/renderer/components/Accordion.tsx12
1 files changed, 7 insertions, 5 deletions
diff --git a/gui/src/renderer/components/Accordion.tsx b/gui/src/renderer/components/Accordion.tsx
index a9b07a7493..87dfdede24 100644
--- a/gui/src/renderer/components/Accordion.tsx
+++ b/gui/src/renderer/components/Accordion.tsx
@@ -104,11 +104,13 @@ export default class Accordion extends React.Component<IProps, IState> {
}
}
- private onTransitionEnd = () => {
- this.props.onTransitionEnd?.();
- if (this.props.expanded) {
- // Height auto enables the container to grow if the content changes size
- this.setState({ containerHeight: 'auto' });
+ private onTransitionEnd = (event: React.TransitionEvent<HTMLDivElement>) => {
+ if (event.target === this.containerRef.current) {
+ this.props.onTransitionEnd?.();
+ if (this.props.expanded) {
+ // Height auto enables the container to grow if the content changes size
+ this.setState({ containerHeight: 'auto' });
+ }
}
};
}