fix(components): [cascader] scrolling to active node is inaccurate (#20877)

This commit is contained in:
btea
2025-05-28 23:28:38 +08:00
committed by GitHub
parent b35c3a54da
commit e19fea2ed7

View File

@@ -284,8 +284,9 @@ export default defineComponent({
`.${ns.namespace.value}-scrollbar__wrap`
)
const activeNode =
menuElement.querySelector(`.${ns.b('node')}.${ns.is('active')}`) ||
menuElement.querySelector(`.${ns.b('node')}.in-active-path`)
menuElement.querySelector(
`.${ns.b('node')}.${ns.is('active')}:last-child`
) || menuElement.querySelector(`.${ns.b('node')}.in-active-path`)
scrollIntoView(container, activeNode)
}
})