question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Scrolled doesn't work on Fullscreen md-sidenav-container

See original GitHub issue

Hello, I’m trying to use scroll using the angular material with the md-sidenav-container element with the fullscreen attribute, but the scrolled method is not invoked. Code:

<md-sidenav-container fullscreen>
    <div infiniteScroll
        [infiniteScrollDistance]="2"
        [infiniteScrollUpDistance]="1.5"
        [infiniteScrollThrottle]="500"
        (scrolled)="onScrolled()">
        <router-outlet></router-outlet>
    </div>
</md-sidenav-container>

Any idea where I am wrong?

Thanks.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:6
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
nicholaspcommented, Aug 10, 2018

hi @orizens i have a similar issue. My setup is a navbar component with mat-sidenav-container and a different component newtask with a table mat-table. I’d like to use inside newtask the infiniteScroll cause the services is inside that component. I tried infiniteScrollContainer in newtask with .sidenav-grid-container (the scrollable div container which is outside newtask.ts). but i got error

ERROR Error: ngx-infinite-scroll {resolveContainerElement()}: selector for
    at resolveContainerElement (ngx-infinite-scroll.es5.js:24)
    at createScroller (ngx-infinite-scroll.es5.js:430)
    at ngx-infinite-scroll.es5.js:564
etc
1reaction
ebduhoncommented, Aug 25, 2017

The css property overflow only works on display: block with a specified size. I think you’re implementation of md-sidenav-container fullscreen makes use flexbox; consequently, an unspecified height in this case does not allow overflow scroll to work. I just implemented a combination of <div class="infinite-scroll-shell" onmouseover="document.body.style.overflow='hidden';" onmouseout="document.body.style.overflow='auto';"><router-outlet></router-outlet></div> I specified a height for the class infinite-scroll-shell. The child component initialized in the router-outlet has the div containing the infiniteScroll directive similar to your code. I would suggest doing a search on “flexbox scroll” for more information.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Router anchorScrolling does not work with Material's mat ...
For the mat-side-nav-container, instead of setting 'height', I set 'min-height' as 100%, so that the scrollable element is the body, and not the ......
Read more >
Scrolled doesn't work on Fullscreen md-sidenav-container
Hello, I'm trying to use scroll using the angular material with the md-sidenav-container element with the fullscreen attribute, but the scrolled method is ......
Read more >
Sidenav - Angular Material
Reacting to scroll events inside the sidenav container​​ To react to scrolling inside the <mat-sidenav-container> , you can get a hold of the...
Read more >
Offcanvas · Bootstrap v5.0
Scrolling the <body> element is disabled when an offcanvas and its backdrop are visible. Use the data-bs-scroll attribute to toggle <body> scrolling and...
Read more >
Fix sidenav on large screens not working - MDBootstrap
Double Navigation with a hidden SideNav & fixed Navbar not showing on full screen <ul class="custom-scrollbar list-unstyled" style="max-height:100vh;"> <!
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found