google / google/material-design-lite
scroll event does not work
Open
- Dominant language
- HTML
- Stars
- 32.2k
- Forks
- 4.9k
- PR merge metrics
- No merged PRs in 30d
Description
It seems that scroll event does not work with MDL. For example following code (From MDN) does not work:
`var last_known_scroll_position = 0;
var ticking = false;
function doSomething(scroll_pos) {
// do something with the scroll position
console.log("abcdefghi");
}
window.addEventListener('scroll', function(e) {
last_known_scroll_position = window.scrollY;
if (!ticking) {
window.requestAnimationFrame(function() {
doSomething(last_known_scroll_position);
ticking = false;
});
}
ticking = true;
});`
Is there a way around? Or I am missing something?
Contributor guide
Assessment
This issue has not been assessed yet.