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

in Gridcell align='middle' not working #266

Closed
nilacseruet opened this issue Jul 10, 2018 · 3 comments
Closed

in Gridcell align='middle' not working #266

nilacseruet opened this issue Jul 10, 2018 · 3 comments

Comments

@nilacseruet
Copy link

nilacseruet commented Jul 10, 2018

I am trying to put my gridcell content in middle. I tested with mdc, its working fine. But on my react, I am using rmwc and trying to do align middle, but it's not working.

Here is my code:

<Grid>
      <GridCell span="12" align='middle'>Test content</GridCell>
</Grid>

I saw from Inspect element, its shows the div class like belows

<div class=" mdc-layout-grid__cell--align-middle">

How can I make it html tag(<div class="" align='middle'>), not into the classname.

I am using react 15.6.
rmcw: 1.7.5

@jamesmfriedman
Copy link
Collaborator

Unfortunately, this is a little difficult at the moment.

It actually does work, but requires some styling. If you look at the material docs they actually have custom sizing on the interior grid element. Use some CSS to set the height of the inner grid. I'll also go ahead and add an enhancement to The grid to allow you to return your own GridInner component with custom styles.

https://codesandbox.io/s/31jkvy6k35

@jamesmfriedman
Copy link
Collaborator

Added a fix so you can specify your own GridInner and give it a height. Will be released with 1.8

@nilacseruet
Copy link
Author

Great, thanks a lot.

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