diff --git a/package.json b/package.json index 9fc4c3cf..dbef24a6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,11 @@ { "name": "react-native-swiper", - "keywords": ["react-component", "react-native", "ios"], - "version": "1.5.9", + "keywords": [ + "react-component", + "react-native", + "ios" + ], + "version": "1.5.10", "description": "Swiper component for React Native.", "main": "index.js", "scripts": { @@ -12,7 +16,9 @@ "test": "npm run lint" }, "pre-commit": { - "run": ["precommit"], + "run": [ + "precommit" + ], "silent": true }, "standard": { @@ -25,7 +31,11 @@ "setImmediate", "fetch" ], - "ignore": ["dist/", "mock/", "node_modules/"] + "ignore": [ + "dist/", + "mock/", + "node_modules/" + ] }, "ava": { "babel": "inherit", diff --git a/src/index.js b/src/index.js index 373423fe..e32fe10f 100644 --- a/src/index.js +++ b/src/index.js @@ -254,7 +254,7 @@ export default class extends Component { // only update the offset in state if needed, updating offset while swiping // causes some bad jumping / stuttering - if (width !== this.state.width || height !== this.state.height) { + if (!this.state.offset || width !== this.state.width || height !== this.state.height) { state.offset = offset } this.setState(state)