Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report] el-tree的勾选框在禁选和不禁选时表现不一致 #22920

Open
aique127 opened this issue Jul 11, 2024 · 10 comments
Open

[Bug Report] el-tree的勾选框在禁选和不禁选时表现不一致 #22920

aique127 opened this issue Jul 11, 2024 · 10 comments

Comments

@aique127
Copy link

Element UI version

2.15.14

OS/Browsers version

window/chrome

Vue version

2.7.16

Reproduction Link

https://codepen.io/aique127/pen/OJePKxd

Steps to reproduce

当default-checked-keys属性含有某个父节点和其部分子节点的key时,checkbox会发生如下不一致的情况:

1、当disabled属性为true时,父节点的checkbox是半选状态,子节点包含在default-checked-keys中的是全选状态、不包含在内的是未选状态。
捕获1

2、当disabled属性为false时,父节点的checkbox是全选状态,子节点全部都是全选状态。
捕获2

这种情况在实际业务中很让人疑惑甚至出现bug,比如我本来父节点和子节点都是全选的,我新增一个未选的子节点后父节点应该变成半选状态才对,但实际上父节点和新增的子节点都变成了全选。

What is Expected?

上述第1 种。

What is actually happening?

根据disabled属性的不同有不同的勾选状态。

看setChecked方法的源码,是因为受到了passValue参数影响,能否将这个属性去掉呢?

image

aique127 added a commit to aique127/element that referenced this issue Jul 11, 2024
@aique127
Copy link
Author

@wangdaodao @webvs2 大佬们,如果不是一个bug,给一个合理的解释也行。。。

@wangdaodao
Copy link
Contributor

wangdaodao commented Jul 22, 2024

@wangdaodao @webvs2 大佬们,如果不是一个bug,给一个合理的解释也行。。。

我感觉算是一个bug,禁用和非禁用情况下,表现应该要保持一致。

@webvs2
Copy link
Contributor

webvs2 commented Jul 22, 2024

I will check this issue in the near future, and I am sorry that I have no time to pay attention to it

@webvs2
Copy link
Contributor

webvs2 commented Jul 22, 2024

Can I also offer pr on this release @aique127
https://github.com/webvs2/element

@aique127
Copy link
Author

Can I also offer pr on this release @aique127 https://github.com/webvs2/element

大佬,我已经提了一个,看看可以吗 #22921

@webvs2
Copy link
Contributor

webvs2 commented Jul 22, 2024

I can sync the past, but the change of the problem is currently in the lts version to fix.
For the release information, see this #22741

@aique127
Copy link
Author

I can sync the past, but the change of the problem is currently in the lts version to fix. For the release information, see this #22741

你好,官方版本不再更新了吗,以后都会更新到elementui-lts?

@webvs2
Copy link
Contributor

webvs2 commented Jul 23, 2024

I can sync the past, but the change of the problem is currently in the lts version to fix. For the release information, see this #22741

你好,官方版本不再更新了吗,以后都会更新到elementui-lts?

For now, the official update frequency is slow, so extending a version with a higher hot update frequency, I recommend using lts

@zhousheng193
Copy link

请问elementui-lts的源码在哪里可以获取?

@justforuse
Copy link
Contributor

Same here, any updates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants