-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
feat(button-group): Adds selectMultiple feature #858
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
Conversation
Codecov Report
@@ Coverage Diff @@
## next #858 +/- ##
=========================================
- Coverage 53.02% 52.7% -0.32%
=========================================
Files 29 29
Lines 513 518 +5
Branches 109 110 +1
=========================================
+ Hits 272 273 +1
- Misses 186 189 +3
- Partials 55 56 +1
Continue to review full report at Codecov.
|
xavier-villelegier
left a comment
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.
Looks good to me 🔥
|
Looks great! 💯 Total rockstar for adding an example & working gif in the PR!! @iRoachie 🎉 |
* Update README.md - fixing typos (#835) * Pass activeOpacity to TouchableOpacity inside Tile (#839) * Pass activeOpacity to TouchableOpacity inside Tile * Update Tile tests * Comment `LinearGradient` for now (FIXME) * feat(example): Cleanup remains from example app split * Fix ListItem (#848) Fix error on empty rightTitle prop by adding !! * Separate checkbox single and checkbox with text styling (#850) * (theming) Unify components under one primary color (#849) * feat(theming): Remove not-used colors * feat(theme): Add primary color and use through components Added in button, button group, badge, and header * Update snapshots * Update underColor on buttonGroup to match selectedColor * Snapshots * Add color for Checkbox * fix(Checkbox): Shifting width between checked and unchecked * chore(packages): Update versions to fix warnings in jest * added listItem right icon size so that it takes rightIcon size, or 28 (#852) * uses thumbStyle.transform values in the thumb View (#820) * [ts] Correct style type for IconObject (#851) * Add ButtonComponent props and linear gradient props (#857) * Add ButtonComponent props * Use `linearGradientProps` + add error on mounting * feat(button-group): Adds selectMultiple feature (#858) Closes #713 * Platform specific SearchBar (#837) 🚀 * Add SearchBar wrapper * Split SearchBar iOS and Android into separate files * Add back default SearchBar * Update root import * Add back Input right/left icon * Rename loadingIcon to loadingProps * Specify `platform` PropType * Add a fallback * Move tests to `searchbar` * Remove old Search component * Fix loading props spreading overriding whole style * Remove useless things * Add tests for SearchBar * Generate snapshots * Add more tests * Update tests * Update documentation * Fix typo * Slightly changed the style of SearchBars * Bump version to `1.0.0-beta2` * Update snapshots from Searchbar changes * feat(button): Re-add custom TouchableComponent * feat(Button): Cleanup button code, update ts definitions (#859) * Update SearchBars PropTypes * feat(searchbar-both) Add additional defaultProps Made tests pass * Fix PropTypes warnings * Update snapshots from searchbar android change * feat(ts): Add definitons for searchbar (#860) * Fix attributes spreading in platform specific searchbars * feat(Button) Fix activeOpacity props * fixed PricingCard to use new Button props * test(jest): Update PricingCard snapshots
|
Very new to javascript, so forgive me, but in the example code does it overwrite the state to equal the last selected index instead of creating an array of selected indexes? |
|
That's fine @NYamaguchi415, welcome to the javascript community! In the example, the So it overwrites the state of selected indices and replaces it with the new set of selected indices. |
|
@iRoachie thanks for the response! is this right? I have a button that console logs this.state.selected and it only outputs a single number instead of an array. Should i not be doing the constructor? |
|
Here's the same code you made, but I pulled out the setState to a method. You can see the |
|
Ohhh thanks @iRoachie , I think it might be a version issue. I just realized prod v1.0.0 wasn't released, so if I want v1.0.0-beta do I need to switch over to yarn? |
|
Nope you don't have to use yarn! |
|
Thanks so much for your help! |
Closes #713
Adds the functionality to select multiple buttons on the button group.
Example: