Fix image preview initial scroll (#959)
This commit is contained in:
parent
0a7b297a6f
commit
86c697aa55
1 changed files with 2 additions and 2 deletions
|
|
@ -84,7 +84,7 @@ export default class ImagePreview extends PureComponent {
|
|||
|
||||
componentDidMount() {
|
||||
InteractionManager.runAfterInteractions(() => {
|
||||
this.scrollView.scrollTo({x: (this.state.currentFile) * this.state.deviceWidth, animated: false});
|
||||
this.scrollView.scrollTo({x: (this.state.currentFile) * this.props.deviceWidth, animated: false});
|
||||
Animated.timing(this.state.wrapperViewOpacity, {
|
||||
toValue: 1,
|
||||
duration: 100
|
||||
|
|
@ -93,7 +93,7 @@ export default class ImagePreview extends PureComponent {
|
|||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
if (this.props.deviceWidth !== nextProps.deviceWidth && Platform.OS === 'android') {
|
||||
if (this.props.deviceWidth !== nextProps.deviceWidth) {
|
||||
InteractionManager.runAfterInteractions(() => {
|
||||
this.scrollView.scrollTo({x: (this.state.currentFile * nextProps.deviceWidth), animated: false});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue