Skip to content

Commit

Permalink
fix: tabs组件聚焦滚动方法异常修复(#662
Browse files Browse the repository at this point in the history
  • Loading branch information
qzhuo committed Jul 18, 2024
1 parent 342a55f commit 9110198
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/vantui/src/tabs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,10 @@ export function Tabs(props: TabsProps) {
}

const scrollIntoView = function (index?: number) {
if (!scrollable) {
index = index ?? currentIndex
if (!scrollable || index === undefined) {
return
}
index = index ?? currentIndex
Promise.all([
getAllRect(null, `.tabs-com-index${indexRef.current} .van-tab`),
getRect(null, `.tabs-com-index${indexRef.current} .van-tabs__nav`),
Expand Down

0 comments on commit 9110198

Please sign in to comment.