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 jumps underlying page if scrolled #93

Closed
mattbrailsford opened this issue Dec 2, 2016 · 4 comments
Closed

Modal jumps underlying page if scrolled #93

mattbrailsford opened this issue Dec 2, 2016 · 4 comments

Comments

@mattbrailsford
Copy link

When you open a modal (In Chrome on Windows at least) if you are scrolled down the page, when the modal opens, the underlying page scrolls back to the top, then on modal close, scrolls back to the previous position.

I understand this is to prevent the background scrolling and thus loosing position while the dialog is open, but when you have a semitrasparent modal background, it looks odd that the page beneath jumps rather than just maintaining it's current position.

I think it would be a much better user experience and less confusing if the page behind could stay at it's current scrolled position.

@mattbrailsford
Copy link
Author

A little poking around, and there seems to be something about chrome not liking html element to have a height of 100%. Content gets cut off.

@mattbrailsford
Copy link
Author

For some reason, setting height:auto !important; on the html element seems to make it work in chrome. Not tested in other browsers though.

@JimBobSquarePants
Copy link
Member

Yeah that would make sense... I just had a quick test with the live responsive site and disabling the height:100% property in [data-locked] selector appeared to give us the behaviour you want. I'm pretty sure it never used to disable scrolling doing that.

I'll have to build and test on multiple browsers to be sure. If you have a chance could you please do so.

@JimBobSquarePants
Copy link
Member

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