-
Notifications
You must be signed in to change notification settings - Fork 267
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: Added support for single select in tree dropdown #217
Conversation
Pull Request Test Coverage Report for Build 1058
💛 - Coveralls |
@mrchief this one should be up for grabs. I did not change the behaviour for simpleSelect so if that is something you think we should do instead, it would require additional changes. I also noticed on the storypage that simpleSelect is not working great with default values, which also applies to this solution. Only one default value should be possible and should be deselected when selecting something else. |
Just one question - with this change, can we manage
Great! Thanks for taking notice and fixing it! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few comments to note
@mrchief Not sure what you mean with an additonal flag. Simpleselect should still behave as before. Did not want to break that so added singleSelect. If you provide both simpleSelect and singleSelect it will behave as before (no children)
Unfortunately did not fix the issue since that requires some more digging. Should be a separate issue. |
# Conflicts: # .codeclimate.yml # .prettierrc # docs/src/stories/Options/index.js # src/checkbox/index.js # src/checkbox/index.test.js # src/index.js # src/tree-manager/flatten-tree.js # src/tree-node/index.js # src/tree-node/node-label.js # src/tree-node/node-label.test.js # src/tree/index.js # yarn.lock
I bundled the selection of rendering / behaviour mode into a single prop instead like we discussed in the keyboard nav PR. We can fill the migration steps with additional breaking changes (for on action) and if bundle the text-props also. Not sure how you want the guide formatted but perhaps you can update it to match your idea. I added the textprops-bundle in this pr as well (without the new labels). With the onaction-changes we would cover all breaking changes needed for a release I think if we want to wait with ARIA/kryboard nav. |
Will it be too much to take out the bundle props out of this? I think radioSelect, ARIA, keyboard nav are all backward compatible changes so we can merge them first and release them incrementally. onActions and bundle props then become part of the v2 release. This release sequence lets v1 folks to not miss out on most new features. Upgrading to major versions is generally considered a bigger undertaking and makes people hesitant in upgrading which would cause them to miss out on accessibility and radio select for no good reason. I'm open to arguments otherwise. |
Well since you became reluctant with the prop additions I thought it would be odd to first add them and then in the next release move them. I see all these features as major additions and the migration steps simple enough to not scare any people away. Radio select and noaction could be 2.0 and wcag 2.x.x with this paving the path to naturally add new labels. But I can revert them... Otherwise the major thing of 2.0 would be to the bundle of props and actually getting onAction to be useful without generating your own specific id:s to base your logic upon. The addition of typings is also the reason why we found the bugs with onAction, which would also be part of the major update. Lots of candy to remove any hesitation from users imho. |
These are major additions, no doubt about that. But not everything is a breaking change. Another reason for releasing them separately is backward compatibility. Id-generation logic, Radio Select, ARIA, Keyboard are all backward compatible. Releasing them as v1 will make it a frictionless upgrade for anyone. And upgrading to 2.0 is not a big hurdle but it still requires some changes. You've done a great job at sending them as separate PRs and I'd like to take advantage of that fact. I can help with this process as well. |
Code Climate has analyzed commit b1d6ef6 and detected 0 issues on this pull request. View more on Code Climate. |
@ellinge Thanks for the quick update. You're the best! I'm gonna merge this unless you have any other changes to make. Let me know. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huge props for sending this!
## What does it do? Adds support for single select in the tree dropdown. Simple select ignores any children so this is a hybrid between the two. Also ignores clicks for simple select when labels are disabled (only checked readonly) The middle dropdown is radioSelect and the last one a simpleSelect https://ellinge.github.io/react-dropdown-tree-select-test/#DevelopTemp-checkeddefault Fixes #119 ## Type of change - [x] Bug fix - [x] New feature
🎉 This PR is included in version 2.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
What does it do?
Adds support for single select in the tree dropdown. Simple select ignores any children so this is a hybrid between the two.
Also ignores clicks for simple select when labels are disabled (only checked readonly)
The middle dropdown is radioSelect and the last one a simpleSelect
https://ellinge.github.io/react-dropdown-tree-select-test/#DevelopTemp-checkeddefault
Fixes #119
Type of change