Skip to content

Commit 1f451c8

Browse files
committed
Fixed issue with centered TabController's TabBar selected indicator not positioned correctly
1 parent 86a732c commit 1f451c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/tabController/TabBar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ class TabBar extends PureComponent {
241241
setItemsLayouts = () => {
242242
const {selectedIndex} = this.context;
243243
// It's important to calculate itemOffsets for RTL support
244-
this._itemsOffsets = _.times(this._itemsWidths.length, (i) => _.chain(this._itemsWidths).take(i).sum().value());
244+
this._itemsOffsets = _.times(this._itemsWidths.length, (i) => _.chain(this._itemsWidths).take(i).sum().value() + this.centerOffset);
245245
const itemsOffsets = _.map(this._itemsOffsets, (offset) => offset + INDICATOR_INSET);
246246
const itemsWidths = _.map(this._itemsWidths, (width) => width - INDICATOR_INSET * 2);
247247
this.contentWidth = _.sum(this._itemsWidths);

0 commit comments

Comments
 (0)