-
-
Notifications
You must be signed in to change notification settings - Fork 46.7k
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
feat(cascader): add Option item disableCheckbox #42024
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## feature #42024 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 619 619
Lines 10676 10570 -106
Branches 2933 2886 -47
==========================================
- Hits 10676 10570 -106
☔ View full report in Codecov by Sentry. |
@BoyYangzai is there a way I can pull your changes locally and start using the feature before it goes to prod? Apologies if this is a silly question but I'd love to use this feature asap. And thank you so so much! |
@georgeciobanu
But I still suggest you to wait for a |
You are amazing, thank you @BoyYangzai! I will wait for another week or two for the final version. I owe you a beer! |
You should send it to feature branch. |
+rc-cascader@3.11.0, 依赖升上来, 并添加测试用例. |
No dependency changes detected. Learn more about Socket for GitHub ↗︎ 👍 No new dependency issues detected in pull request Bot CommandsTo ignore an alert, reply with a comment starting with Pull request alert summary
|
@georgeciobanu |
Y'all are amazing, thank you so much! |
done - react-component/cascader#410 |
@georgeciobanu new verison |
Thank you @BoyYangzai, you are awesome! If you are curious why I needed the feature, you can check it out at https://human-software-dev.herokuapp.com (it might take me a few days to update the UI and push a new version using the new feature). |
@BoyYangzai the original design you came up with (#41997 (comment)) was the correct one. I want the checkbox to not show (aka hide), but instead the feature was modified to disable the checkbox (which is not what I wanted). Is there a way to hide the checkbox for select items? |
Hi bro! the original design is good but we discussed it , more antd members thought if you disabeled the checkbox in cascaderItem,then you should't select the cascaderItem. I'm sorry to tell you that there's no way to hide just the styles😫 ((( Whisper good news your name appears on the antd website as a feat contributor 😄 |
I barely did anything but that's great to hear 😄 @BoyYangzai I will try to build a custom version of AntD with your changes. Fingers crossed it works 🤞🏻💪🙏 |
@BoyYangzai how can I make the Cascader (with search enabled) display the cursor after the generated displayRender UI? So I want the cursor and search input to behave in Single mode the same way it behaves in multiple mode (put the cursor after the UI and allow the user to search) |
@georgeciobanu oh-- do you mean like this? this has not disabled cursor style if it is not right |
Thank you so much for trying to help me! I figured out a different way to do what I need. Now I owe you a whole case of beers! 😋👍🙏💪 |
disableCheckbox attribute does not hide checkbox , it just disables checkbox, the checkbox still exists in the view. how can I hide the checkbox |
I used this trick to hide the checkbox:
The checkbox will be hidden. Recording.2024-03-11.124806.mp4 |
Awesome and so creative! Thank you so much, I owe you a beer 🍺
…On Sun, Mar 10, 2024 at 10:49 PM Hirus ***@***.***> wrote:
I used this trick to hide the checkbox:
Using disableCheckbox it's returns a class named:
ant-cascader-checkbox-disabled
In Cascader component, add more classes by using prop
popupClassname="hidden-checkbox", you can use another name you want
custom CSS for antd by .hidden-checkbox .ant-cascader-checkbox-disabled {
display: none;}
The checkbox will be hidden.
That's a style CSS trick and it's working for me
https://github.com/ant-design/ant-design/assets/65271147/ac79f4da-8006-49e6-8c47-a9dd9e6fe8cc
—
Reply to this email directly, view it on GitHub
<#42024 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJ3KB7TRZLKK6Z7VX5F73DYXVAYNAVCNFSM6AAAAAAXM6UILGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBXGY3TONBTGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Cheer 🍻, hope the trick can help you ... |
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
💡 Background and solution
📝 Changelog
options
supportdisableCheckbox
prop.options
支持disableCheckbox
在多选时禁用勾选框。☑️ Self-Check before Merge
🚀 Summary
🤖 Generated by Copilot at 987c7f5
Added a new feature to the
Cascader
component that allows disabling checkboxes for some items. Updated the documentation and the demo to show how to use the newuncheckableItemValues
prop.🔍 Walkthrough
🤖 Generated by Copilot at 987c7f5
uncheckableItemValues
prop toCascader
component and its subcomponents to enable users to specify items that cannot be selected with checkboxes (link, link, link)multiple.tsx
demo to demonstrate the usage ofuncheckableItemValues
prop by passing['2-1-2']
as the value, which makes the item with the path2-1-2
uncheckable (link)multiple.md
documentation to explain the new feature of uncheckable items and theuncheckableItemValues
prop in bothzh-CN
anden-US
sections (link)