Scroll events not getting fired when content inside md-content is scrolled
See original GitHub issueBug, feature request, or proposal:
Bug
What is the expected behavior?
When you scroll the page and the md-content’s height is larger than the available space, page scroll events should be fired.
What is the current behavior?
They don’t get fired.
Please note, this was working correctly in the alpha5 version but now it’s broken in v2.0.0.-alpha6.
To add further information, consider this to be the layout:
<md-sidenav-layout>
<md-sidenav #sidenav>
<md-nav-list>
...
</md-sidenav>
<md-toolbar style="background-color: #2db1eb; color: white">
...
</md-toolbar>
<router-outlet></router-outlet>
</md-sidenav-layout>
When the content placed inside <router-outlet> is larger than the available height, the scroll events are not firing. This is preventing me from implementing infinite scroll on various components.
Can you please let me know if there is a workaround for this?
Many thanks,
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:13 (5 by maintainers)
Top Results From Across the Web
Why could window scroll event not being fired - Stack Overflow
It could be that some element (the body itself or some nested div ) has the css overflow property set to scroll ....
Read more >JavaScript Scroll Events, Event Throttling & Passive Events
When you scroll a document or an element, the scroll events fire. You can trigger the scroll events in the following ways, for...
Read more >Document: scroll event - Web APIs - MDN Web Docs - Mozilla
The scroll event fires when the document view has been scrolled. To detect when scrolling has completed, see the Document: scrollend event.
Read more >.scroll() | jQuery API Documentation
The scroll event is sent to an element when the user scrolls to a different place in the element. It applies to window...
Read more >Scroll Events and Intersection Observer - Beginner JavaScript
The way to do it now is called Intersection Observer. Rather than figuring out how far along the page the user has scrolled,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Looks like #703 change behavior.
scroll
event fires bymd-content
.As a workaround, i think, you can wrap all what not in
md-sidenav
intodiv
and listenscroll
event on it.It seems to me that there is some shortcoming in sidenav architecture. I do not understand why the side navigation should wrap a content and override properties and behavior of main container. IMO sidenav should be in the container next to other content, rather than around it. For exemple md-toolbar doesn’t wrap main content. Because of this, there are problems with scrolling and positioning of elements.