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

<Row> and <Col> requires style={{ height: '100%' }} #101

Open
diegoarcega opened this issue Apr 21, 2020 · 2 comments
Open

<Row> and <Col> requires style={{ height: '100%' }} #101

diegoarcega opened this issue Apr 21, 2020 · 2 comments

Comments

@diegoarcega
Copy link

diegoarcega commented Apr 21, 2020

problem

image

I am having to add this inline style to the Row and Col in order for my layout to stretch vertically and takes the full height of the area I want.

image

Isn't there a more elegant way of doing this with this component?

@santosfrancisco
Copy link
Owner

Hi @diegoarcega, how are you? Analyzing this behavior, I think that the grid should keep each Row with the height of its content. Otherwise, whoever uses Row would have to force the opposite behavior. What you can do is create a styled row using styled-components for example. Something like that:

import { Container, Row as AwesomeRow, Col } from 'react-awesome-styled-grid'
import styled from 'styled-components'

const Row = styled(AwesomeRow)`
  height: 100%;
  // ... more styles here
`
<Container>
  <Row>
    <Col>
      <Form>
        { ... }
      </Form>
    </Col>
  </Row>
</Container>

Makes sense?

@diegoarcega
Copy link
Author

I'm alright with doing that, I was just expecting a more elegant way of doing this, maybe pass a props down to Row and Col,

<Container>
  <Row fullHeight>
    <Col fullHeight>
      <Form>
        { ... }
      </Form>
    </Col>
  </Row>
</Container>

Do you think that adding this feature would hurt the essentials of the lib?

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

No branches or pull requests

2 participants