Skip to content

Commit

Permalink
fix slider race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
hiagolcm committed Oct 28, 2020
1 parent e81c264 commit 99dfcee
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Fixed

- Slider race condition.

## [9.133.0] - 2020-10-14

### Added
Expand Down
8 changes: 4 additions & 4 deletions react/components/Slider/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,16 +238,16 @@ export default class Slider extends Component {
const translatePx = this.getTranslateValueForInputValue(value, position)

requestAnimationFrame(() => {
this.setState({
this.setState(state => ({
values: {
...this.state.values,
...state.values,
[position]: value,
},
translate: {
...this.state.translate,
...state.translate,
[position]: translatePx,
},
})
}))
})
}

Expand Down

0 comments on commit 99dfcee

Please sign in to comment.