This repository has been archived by the owner on Aug 29, 2023. It is now read-only.
Scroll Bug. #9370
Labels
has: Pull Request
A PR has been created to address this issue
P5: nice to have
These issues will not be fixed without community contributions.
resolution: fixed
type: bug
Milestone
When I trying to open the menu or something like it I have a problem with page scrolling. This bug gives me a pain for a long time.
Maybe this problem is already discovered by you but I want to write my observations all the same.
Ok. I checked the code with Chrome debugger and discovered following:
When the script trying to modify body's style it uses $mdUtils.scrollTop function.
This function has a line with small bug:
return scrollTop || Math.abs(element[0].getBoundingClientRect().top);
angular-material.js:1032 (version v1.1.0-rc.5)
scrollTop variable can be equal zero, that in this case it will be converted to boolean and then second expression will be evaluated. In my case the returned value was 60.
You can use strict equation with null and undefined instead.
I wrote this small directive for temporary fix this bug till Angular Material will be updated:
`
`
It simply prevents the scrolling to 0.
The text was updated successfully, but these errors were encountered: