Skip to content

Commit

Permalink
fix issue leecade#1171 - slide alignment issue (leecade#1174)
Browse files Browse the repository at this point in the history
Slider doesn't calculate offsets correctly when slider isn't full screen because when componentDidUpdate is called and updates the state based on an initState call it uses the return from Dimensions.get('window') instead of the value from props if there is one. The value that should be used is calculated just before the incorrect value is used.
  • Loading branch information
samparmenter authored Apr 8, 2020
1 parent 2cde488 commit 1356b63
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export default class extends Component {
}

initState.offset[initState.dir] =
initState.dir === 'y' ? height * props.index : width * props.index
initState.dir === 'y' ? initState.height * props.index : initState.width * props.index

this.internals = {
...this.internals,
Expand Down

0 comments on commit 1356b63

Please sign in to comment.