Skip to content

Commit 268d87a

Browse files
authored
fix(components): [tabs] prevent scroll tab into view after focusing it (element-plus#9990)
closed element-plus#9980
1 parent 95c69fe commit 268d87a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/components/tabs/src/tab-nav.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ const TabNav = defineComponent({
233233
nextIndex = 0
234234
}
235235
}
236-
tabList[nextIndex].focus() // 改变焦点元素
236+
tabList[nextIndex].focus({ preventScroll: true }) // 改变焦点元素
237237
tabList[nextIndex].click() // 选中下一个tab
238238
setFocus()
239239
}

0 commit comments

Comments
 (0)