Skip to content
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

Grid: allow multiple values for reversed prop #2222

Closed
dhilgarth opened this issue Oct 20, 2017 · 8 comments
Closed

Grid: allow multiple values for reversed prop #2222

dhilgarth opened this issue Oct 20, 2017 · 8 comments
Assignees

Comments

@dhilgarth
Copy link

Steps

Trying to create a grid whose columns are reversed on Mobile and Tablet.
I tried:

<Grid reversed="computer tablet">
// or
<Grid reversed="computer,tablet">
// or
<Grid reversed="computer|tablet">
// or
<Grid reversed={["computer","tablet"]}>

Expected Result

Same behavior as in Semantic UI: https://codepen.io/dhilgarth/pen/Naezay

Actual Result

Error message:

Warning: Failed prop type: Invalid prop reversed of value computer,tablet supplied to GridRow, expected one of ["computer","computer vertically","mobile","mobile vertically","tablet","tablet vertically"].

Version

0.75.1

Testcase

https://codesandbox.io/s/w0n3wp9j48

See also my question on SO

@layershifter layershifter changed the title Allow multiple values for reversed setting on Grid Grid: allow multiple values for reversed prop Oct 20, 2017
@layershifter layershifter self-assigned this Oct 20, 2017
@Maxhodges
Copy link

Maxhodges commented Nov 5, 2017

which syntax is supported?

<Grid reversed="computer tablet">

<Grid reversed="computer,tablet">

<Grid reversed="computer|tablet">

<Grid reversed={["computer","tablet"]}>

@layershifter
Copy link
Member

<Grid reversed="computer tablet"/>

https://react.semantic-ui.com/collections/grid#grid-example-reversed-multiple

@Rex90
Copy link

Rex90 commented Jan 22, 2018

How can we have it reversed for all the sizes? is there catchall?

@webberwang
Copy link

webberwang commented Jan 29, 2018

<Grid reversed="all" />

would be great

@brianespinosa
Copy link
Member

@webberwang the reversed styling is for responsively switching the order of grid items per device. If you wanted to switch the order of the row on all devices the correct way to do this would be to simply render the Grid.Columns in your rows in the order you would like them to show up and not reverse them at all.

@webberwang
Copy link

webberwang commented Jan 29, 2018

@brianespinosa I was rendering an array of Grid's, I'm offsetting every other Grid to make a zig zag layout for text on one side and image on another.

I think there could still be a use case for "all". In my case I can't control the order manually if I'm mapping the components.

or just

<Grid reversed />

@brianespinosa
Copy link
Member

@webberwang the great news is that you can actually do that in your map. If you want to post a question and a link to it on Stack Overflow with an example of what you are trying to do with your markup and the code for your map, I can go answer you there. 👍

@webberwang
Copy link

@brianespinosa oh thanks for that tip! I forgot we can do that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants