Skip to content

Commit 4389ee7

Browse files
committed
use containerWidth for calculations
1 parent 1b2dcb0 commit 4389ee7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/tabController/TabBar.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ class TabBar extends PureComponent {
168168
get centerOffset() {
169169
const {centerSelected} = this.props;
170170
const guesstimateCenterValue = 60;
171-
return centerSelected ? Constants.screenWidth / 2 - guesstimateCenterValue : 0;
171+
return centerSelected ? this.containerWidth / 2 - guesstimateCenterValue : 0;
172172
}
173173

174174
measureItems = async () => {
@@ -223,7 +223,7 @@ class TabBar extends PureComponent {
223223
const {centerSelected} = this.props;
224224
const itemOffset = this._itemsOffsets[index];
225225
const itemWidth = this._itemsWidths[index];
226-
const screenCenter = Constants.screenWidth / 2;
226+
const screenCenter = this.containerWidth / 2;
227227

228228
if (itemOffset && itemWidth) {
229229
if (centerSelected) {

0 commit comments

Comments
 (0)