diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-05-21 13:23:19 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-05-21 13:23:19 +0200 |
| commit | 0b4241c0a8e0d3fa9c130d3ca6b3d64cdda43cac (patch) | |
| tree | b9b202549d7851937cfa86a4749af8bbd96afc94 /app/client/common/slider.component.js | |
| parent | 9b66e84a72eb1cf0a8caf19450f348f194c21d4f (diff) | |
toggles and layout adjust
Diffstat (limited to 'app/client/common/slider.component.js')
| -rw-r--r-- | app/client/common/slider.component.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/client/common/slider.component.js b/app/client/common/slider.component.js index c8b4ed1..ca22689 100644 --- a/app/client/common/slider.component.js +++ b/app/client/common/slider.component.js @@ -15,7 +15,12 @@ class Slider extends Component { this.handleInput = this.handleInput.bind(this) this.handleRange = this.handleRange.bind(this) } - + componentWillReceiveProps(nextProps) { + const next_value = nextProps.opt[nextProps.name] + if (next_value !== this.state.value) { + this.setState({ value: next_value }); + } + } handleInput(e){ let { name, opt } = this.props let old_value = opt[name] |
