aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/button-group/button-group.component.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/components/button-group/button-group.component.js')
-rw-r--r--ui/app/components/button-group/button-group.component.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/ui/app/components/button-group/button-group.component.js b/ui/app/components/button-group/button-group.component.js
index 440b3c4f7..723f9b526 100644
--- a/ui/app/components/button-group/button-group.component.js
+++ b/ui/app/components/button-group/button-group.component.js
@@ -23,6 +23,12 @@ export default class ButtonGroup extends PureComponent {
: this.props.defaultActiveButtonIndex,
}
+ componentDidUpdate (prevProps, prevState) {
+ if (typeof this.props.newActiveButtonIndex === 'number' && prevState.activeButtonIndex !== this.props.newActiveButtonIndex) {
+ this.setState({ activeButtonIndex: prevProps.newActiveButtonIndex })
+ }
+ }
+
handleButtonClick (activeButtonIndex) {
this.setState({ activeButtonIndex })
}