-
Notifications
You must be signed in to change notification settings - Fork 379
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
when <RowDefinition> children contains <ColumnDefinition> and an arra… #837
base: master
Are you sure you want to change the base?
when <RowDefinition> children contains <ColumnDefinition> and an arra… #837
Conversation
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.
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}; |
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.
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) => { |
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.
Would a simpler solution be to _.flatten(children).reduce(...)
here?
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.
it's better!
just updated to current version and added sotrybook example |
0a4bd1b
to
00f3f79
Compare
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