Skip to content

Commit

Permalink
Fix initial index for ios
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Iankovskyi committed Aug 13, 2017
1 parent 39a24a3 commit 97e4551
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
18 changes: 14 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand All @@ -12,7 +16,9 @@
"test": "npm run lint"
},
"pre-commit": {
"run": ["precommit"],
"run": [
"precommit"
],
"silent": true
},
"standard": {
Expand All @@ -25,7 +31,11 @@
"setImmediate",
"fetch"
],
"ignore": ["dist/", "mock/", "node_modules/"]
"ignore": [
"dist/",
"mock/",
"node_modules/"
]
},
"ava": {
"babel": "inherit",
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 97e4551

Please sign in to comment.