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

[IxCheckbox] 复选框下嵌套下拉多选组件时,点选下拉组件的非选择框区域,选择框的勾选状态不会发生改变。 #2003

Open
1 task done
Dreamer-Somebody opened this issue Oct 28, 2024 · 2 comments
Assignees
Labels
bug Something isn't working Comp:Checkbox

Comments

@Dreamer-Somebody
Copy link

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

重现 link

Steps to reproduce

如上述复现链接,在下拉框内点选非选择框区域来进行选项的选择。
image

What is expected?

选择框的勾选状态能正常联动。

What is actually happening?

选择框的勾选状态没有联动。

Environment Info

Any additional comments? (optional)

@idux-bot idux-bot bot added the IxCheckbox label Oct 28, 2024
@Dreamer-Somebody
Copy link
Author

问题原因是packages/components/checkbox/src/Checkbox.tsx第 53 行,通过 inject 来判断当前的 checkbox 父组件是否是 checkboxGroup。
image

但如果任意一级的祖先组件是 checkboxGroup 就会导致 inject 有误,随后导致 180 行判断有误,accessor 从祖先级别的 checkboxGroup 获取,导致 此 bug。
image

@danranVm danranVm added bug Something isn't working Comp:Checkbox and removed IxCheckbox labels Dec 5, 2024
@danranVm
Copy link
Member

danranVm commented Dec 5, 2024

@liuzaijiang @sallerli1 是不是可以在 Select 组件类手动注入下 CheckboxGroupToken 为 null ? 避免这种嵌套用法的时候,误拿了上层的 token,

Radio 组件也是一样的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Comp:Checkbox
Projects
None yet
Development

No branches or pull requests

3 participants