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 styles causes document to scroll to top in Chrome #132

Closed
mjbradford89 opened this issue Feb 12, 2016 · 2 comments
Closed

modal styles causes document to scroll to top in Chrome #132

mjbradford89 opened this issue Feb 12, 2016 · 2 comments

Comments

@mjbradford89
Copy link

This can be reproduced at http://liferay.github.io/lexicon/content/modals/ and also in liferay-portal. I think this is caused by the styles from the class modal-open that is appended to the body.

  1. Navigate to http://liferay.github.io/lexicon/content/modals/.
  2. Scroll down a bit and click the 'Large Modal' button or the 'Full Screen Modal' button.
  3. Close the modal.

Result: The page is scrolled back to the top.

Note: It seems like for the bottom 3 buttons on the Modal demo page, the bootstrap modal component is resetting the scroll position after the modal is closed.

@natecavanaugh
Copy link
Contributor

Thanks @mjbradford89

@pat270 this is being caused by the modal-open class being defined here:
https://github.com/liferay/lexicon/blob/master/src/scss/lexicon-base/_modals.scss#L83-L89

I can't remember why that was added. Do you happen to remember?

@pat270
Copy link
Member

pat270 commented Feb 16, 2016

Hey @natecavanaugh and @mjbradford89, those styles were added specifically for ios. Long content under the modal would be scrollable without position fixed because ios doesn't respect overflow hidden on the body. I'll find a work around.

pat270 added a commit to pat270/clay that referenced this issue Feb 18, 2016
pat270 added a commit to pat270/clay that referenced this issue Feb 19, 2016
pat270 added a commit to pat270/clay that referenced this issue Feb 19, 2016
pat270 added a commit to pat270/clay that referenced this issue Feb 19, 2016
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

3 participants