Skip to content

Commit 61f5e96

Browse files
committed
fix: tabs should show left edge
1 parent 40099b0 commit 61f5e96

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/packages/tabs/tabs.taro.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,7 @@ export const Tabs: FunctionComponent<Partial<TabsProps>> & {
208208
const left = titleRects
209209
.slice(0, index)
210210
.reduce((prev: number, curr: RectItem) => prev + curr.width, 0)
211-
to = left - (navRectRef.current.width - titleRect.width) / 2
212-
// to < 0 说明不需要进行滚动,页面元素已全部显示出来
213-
if (to < 0) return
214-
to = rtl ? -to : to
211+
to = rtl ? -left : left
215212
}
216213
nextTick(() => {
217214
scrollWithAnimation.current = true

0 commit comments

Comments
 (0)