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

MDL breaks the scrollTop attribute #1852

Closed
raffomania opened this issue Nov 6, 2015 · 4 comments
Closed

MDL breaks the scrollTop attribute #1852

raffomania opened this issue Nov 6, 2015 · 4 comments

Comments

@raffomania
Copy link

When using MDL, the scrollTop attribute of elements, e.g. the body, does not get updated and cannot be set. This breaks tools like Vimium that scroll the page for you.

You can test this on http://www.getmdl.io/started/. Scroll down the page a bit, open the console and enter

document.getElementsByTagName('body')[0].scrollTop

This will always return 0, even if you scrolled the body. If you try and enter that line on other pages, e.g. github, it will return a number indicating how far you have scrolled.

The same problem goes with setting the scrollTop attribute. It won't work on pages using MDL:

document.getElementsByTagName('body')[0].scrollTop = 50

But will work on other pages.

@Garbee
Copy link
Collaborator

Garbee commented Nov 6, 2015

This is a problem coming from how layout is done. Nothing we can do. The 2.X redactor should handle this and numerous other problems.

@Garbee Garbee closed this as completed Nov 6, 2015
@mneuschaefer
Copy link

even one year later, scrollTop does not work, neither does the window.screenY property. My current workaround is recreating some of the styles with bootstrap while rebuilding the css from scratch

@stefanahman
Copy link

Found this: https://stackoverflow.com/a/32037542/1280693

Worked for me.

@ravi292
Copy link

ravi292 commented Sep 7, 2017

Instead of doing above do this document.getElementsByClassName('.mdl-layout__content')[0].scrollTop
Worked for me

Reference link : - https://stackoverflow.com/a/32037542/1280693

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

5 participants