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

Default display:block interferes with flexbox layouts and other complications #47

Open
jmbldwn opened this issue Sep 24, 2020 · 1 comment

Comments

@jmbldwn
Copy link

jmbldwn commented Sep 24, 2020

I ended up making my own wrapper to inherit display properties to fix this. Curious why this isn't the default?

import React from 'react';
import PropTypes from 'prop-types';
import LoadingOverlay from 'react-loading-overlay';

const Loading = ({ active, text, children }) => (
    <LoadingOverlay
        active={active}
        spinner text={text}
        styles={{
            wrapper: {
                display: 'inherit',
                'flex-grow': 'inherit'
            }
        }}>
        {children}
    </LoadingOverlay>
);

Loading.propTypes = {
    active: PropTypes.bool,
    text: PropTypes.string,
    children: PropTypes.node
};

export default Loading;
@maximiliancsuk
Copy link

Having the same issue!

@jmbldwn Thanks for the code snippet, that worked well for me! I additionally had to set flex-direction to 'inherit' to get it to work. There might be more important css properties to inherit, depending on the usecase.

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