fix(components): [tabs] prevent scroll tab into view after focusing it (#9990)

closed #9980
This commit is contained in:
dopamine 2022-10-04 09:51:57 +08:00 committed by GitHub
parent 95c69fe88e
commit 268d87a03b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -233,7 +233,7 @@ const TabNav = defineComponent({
nextIndex = 0
}
}
tabList[nextIndex].focus() // 改变焦点元素
tabList[nextIndex].focus({ preventScroll: true }) // 改变焦点元素
tabList[nextIndex].click() // 选中下一个tab
setFocus()
}