Skip to content
This repository has been archived by the owner on Jun 28, 2021. It is now read-only.

Dialog position is off the screen #370

Closed
pablocubico opened this issue Aug 16, 2016 · 1 comment
Closed

Dialog position is off the screen #370

pablocubico opened this issue Aug 16, 2016 · 1 comment
Labels

Comments

@pablocubico
Copy link
Contributor

I can't see the Dialog opened by using the component, I think the offending line is:

https://github.com/tleunen/react-mdl/blob/master/src/Dialog/Dialog.js#L30

Which takes body.clientHeight into account.

For a dialog over a fixed overlay, I would use the window height instead of the body, to ensure that the dialog is placed within the limits of the viewport.

The Dialog is getting these styles:
captura de pantalla 2016-08-16 a las 15 51 03

Which are obviously based on the calculations made using body.clientHeight:
captura de pantalla 2016-08-16 a las 15 51 29

I can make a pull request to fix that line if you need me to.

@tleunen
Copy link
Owner

tleunen commented Aug 16, 2016

Hmm indeed, it seems the window.innerHeight is more appropriate.
Thanks for the report! And yes, a PR is always welcome :)

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

No branches or pull requests

2 participants