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

Modal window fixed height #1308

Closed
iamdanthedev opened this issue Feb 12, 2017 · 2 comments
Closed

Modal window fixed height #1308

iamdanthedev opened this issue Feb 12, 2017 · 2 comments

Comments

@iamdanthedev
Copy link

Hello

Is there any simple way to open modal at fixed screen height (minus margins) ?
By default a modal window tries to center itself vertically which causes problematic UX when modal content changes

@levithomason
Copy link
Member

levithomason commented Feb 12, 2017

The answer is yes, you should, but you cannot currently. It appears the Modal does not spread the user's style prop on the Modal. Technically, you should be able to do this to pin the modal's top position:

<Modal style={{ marginTop: '1rem' }} />

The marginTop style is calculated for centering, however, the props are applied like so:

<ElementType {...rest} className={classes} style={{ marginTop }} ref={c => (this._modalNode = c)}>

Style here should be: style={{ marginTop, ...style }} where the style variable is from props. PRs welcome!

@lazy-ninja
Copy link

Hi, @levithomason can I work on it?

rajchourasia pushed a commit to rajchourasia/Semantic-UI-React that referenced this issue Mar 21, 2017
rajchourasia pushed a commit to rajchourasia/Semantic-UI-React that referenced this issue Mar 23, 2017
levithomason pushed a commit that referenced this issue Mar 25, 2017
* fix(Modal): spread the user's style prop on the Modal

Fixes #1308

* fix(Modal): spread the user's style prop on the Modal

Incorporating review comments. Fixes #1308

* fix(Modal): spread the user's style prop on the Modal
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

3 participants