when <RowDefinition> children contains <ColumnDefinition> and an arra…#837
Open
JaosnHsieh wants to merge 3 commits intoGriddleGriddle:masterfrom
Open
when <RowDefinition> children contains <ColumnDefinition> and an arra…#837JaosnHsieh wants to merge 3 commits intoGriddleGriddle:masterfrom
JaosnHsieh wants to merge 3 commits intoGriddleGriddle:masterfrom
Conversation
dahlbyk
requested changes
Nov 27, 2018
Contributor
dahlbyk
left a comment
There was a problem hiding this comment.
Thanks for this contribution! Could you add an example of this feature to the Storybook to confirm it works as expected?
src/utils/columnUtils.js
Outdated
| previous[current.props.id] = {order: offset + i, ...current.props}; | ||
| if(Array.isArray(current)){ | ||
| current.forEach((c)=>{ | ||
| previous[c.props.id] = {order: offset + i, ...c.props}; |
Contributor
There was a problem hiding this comment.
This will end up producing multiple columns that share an order value, which can produce unexpected behavior.
src/utils/columnUtils.js
Outdated
| @@ -25,7 +25,14 @@ export function getColumnProperties(rowProperties, allColumns=[]) { | |||
| // build one object that contains all of the column properties keyed by id | |||
| children.reduce((previous, current, i) => { | |||
Contributor
There was a problem hiding this comment.
Would a simpler solution be to _.flatten(children).reduce(...) here?
Author
|
just updated to current version and added sotrybook example |
0a4bd1b to
00f3f79
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Griddle major version
1.13.1
Changes proposed in this pull request
Wish could have props.Children is and array of at the same time.
Why these changes are made
#836
Are there tests?
One story added as test