mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
fix(components): [cascader] scrolling to active node is inaccurate (#20877)
This commit is contained in:
@@ -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)
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user