Skip to content

[Bug Report] When the cascade selector dynamically changes 'options' and 'value', the 'handleExpand' method of the cascade panel throw an error: "Cannot read property 'level' of null" #18369

@WalkingLianShou

Description

@WalkingLianShou

Element UI version

2.13.0

Component Name

cascader

OS/Browsers version

Win10 x64 / Chrome 78.0.3904.97

Vue version

2.6.6

Reproduction Link

https://jsfiddle.net/WalkingLianshou/wb6sat3h/31/

Steps to reproduce

Switching the console directly to the selector will throw an error, and when switching again, the default selection and expansion of the cascade selector will be wrong.
直接对选择器进行切换控制台就会抛错,并且再次重新切换时,级联选择器的默认选中及展开出现错误

What is Expected?

After the selector is switched, the cascading selector is not thrown first, and the second is selected correctly. After switching back again, the style and display are normal.
选择器切换后,级联选择器首先不抛错,其次正确的选中,再次切换回来后,样式及展示正常;

What is actually happening?

After switching the selector directly, throw "Cannot read property 'level' of null" and switch back to the style and default expansion error again.
直接切换选择器后抛错"Cannot read property 'level' of null",再次切换回来样式及默认展开出现错误;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions