Skip to content

Commit 51df1ba

Browse files
authored
Merge pull request #725 from shoutem/hotfix/5.2.1
Hotfix/5.2.1 - master
2 parents ed8e0df + fef5ac5 commit 51df1ba

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

components/HorizontalPager/HorizontalPager.js

+9-6
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,20 @@ class HorizontalPager extends PureComponent {
5757
}
5858

5959
onLayoutContainer(event) {
60-
const { width: newWidth, height: newHeight } = event.nativeEvent.layout;
61-
const { scrolledToInitialIndex, width, height } = this.state;
60+
const { width, height } = event.nativeEvent.layout;
61+
const {
62+
width: currentWidth,
63+
height: currentHeight,
64+
scrolledToInitialIndex,
65+
} = this.state;
6266

63-
if (width === newWidth && height === newHeight) {
67+
if (currentWidth === width && currentHeight === height) {
6468
return;
6569
}
6670

6771
this.setState({ width, height }, () => {
68-
// By checking has the pager scrolled to initial index, we're avoiding
69-
// a weird issue where pager would scroll back to initial index after
70-
// swiping to other index
72+
// By checking has the pager scrolled to initial index, we're avoiding weird issue
73+
// where pager would scroll back to initial index after swiping to other index
7174
if (!scrolledToInitialIndex) {
7275
requestAnimationFrame(() => this.scrollToInitialPage());
7376
}

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@shoutem/ui",
3-
"version": "5.2.0",
3+
"version": "5.2.1",
44
"description": "Styleable set of components for React Native applications",
55
"scripts": {
66
"lint": "eslint .",

0 commit comments

Comments
 (0)