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

Is it posible to skip/override default styles applied in JS? #110

Closed
algbeta opened this issue Feb 17, 2017 · 8 comments
Closed

Is it posible to skip/override default styles applied in JS? #110

algbeta opened this issue Feb 17, 2017 · 8 comments

Comments

@algbeta
Copy link

algbeta commented Feb 17, 2017

Hi Ben!
Thank you very much for a great work!

Skipping inline css made my life a lot easier.
But there is a thing I don't find pretty.
When there is a grid with only one row it still has default 500px height.
Is it possible to exclude those default styles applied with js too?
I created my own styles and would like to rely on them.

Is that possible?
Thank you!

@bencripps
Copy link
Owner

Sure thing. When you instantiate grid now, if you provide height: false, no height will be set.

import { Grid } from 'react-redux-grid';

<Grid height={false} />

@algbeta
Copy link
Author

algbeta commented Feb 17, 2017

@bencripps and what about other styles? with height={false} i have problems displaying edit dialog in mode=inline (it's hidden)

@bencripps
Copy link
Owner

Hmm, not sure what you mean. With height: false the inline editor works in the demo. Can you try in the demo?

@algbeta
Copy link
Author

algbeta commented Feb 17, 2017

I meant that Save/Cancel buttons are hidden in inline edit mode.
I've run your demo with one item. What I see when try to edit an item:
screenshot 27 _edited

It happens bc of top property for .react-grid-inline-editor which is set in JS and overflow applied in .react-grid-table-container.
Since I applied my own styles, I can change overflow easily but I'm not willing to change top prop

@bencripps
Copy link
Owner

bencripps commented Feb 17, 2017

Yeah, this happens when there's only a single row. If you had more rows this wouldn't be an issue. We can't change the overflow: hidden for the grid-container since that's what makes it scrollable.

Can you make the min-height something that allows the editor to work even if there's a single row?

@algbeta
Copy link
Author

algbeta commented Feb 17, 2017

All right but the question is : is that possible to override top property for editor container (or any other property set in JS) in easy way?

@bencripps
Copy link
Owner

bencripps commented Feb 17, 2017

Since the top is set dynamically via JS, the only way would be to override it with an !important in your specific CSS.

We could add a prop that just makes the editor stick to the bottom?

@algbeta
Copy link
Author

algbeta commented Feb 20, 2017

Hi again. Thank you for clarification. I will use !important to fix styles locally on my project so it's up to you to add changes to editor styles.

Best regards!

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