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.

Scroll inside div with overflow:scroll not firing

See original GitHub issue

When using infinite-scroll it’s just firing when the body has scrolled, but not the actual div which is inside the body and may contains the infinite list.

Is it possible to select the element id which the infinite scroll listener should watch for?

<style>
.list{
  overflow-x: hidden;
  overflow-y: scroll;
  height:90%;
}
</style>
<div class="list">
  <div infinite-scroll (scrolled)="scroll()" *ngFor="let a of b">
     <!-- ... -->
    </div>
</div>

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
TSGamescommented, Oct 14, 2016

Damn, I’m so sorry, completely missed the scrollWindow attribute, thanks a lot, sorry!

0reactions
TSGamescommented, Oct 14, 2016

I see. My issue was that I’ve attached the *ngFor list directly on the infinite-scroll item which doesn’t work in this case.

Read more comments on GitHub >

github_iconTop Results From Across the Web

scroll() event not firing when attached to a div - Stack Overflow
"scroll" only works when the element is actually scrollable / scrolling. If you want scroll data regardless of element size, you can use...
Read more >
.scroll() | jQuery API Documentation
A scroll event is sent whenever the element's scroll position changes, regardless of the cause. A mouse click or drag on the scroll...
Read more >
Element: scroll event - Web APIs | MDN
The scroll event fires when an element has been scrolled. To detect when scrolling has completed, see the Element: scrollend event.
Read more >
onscroll Event - W3Schools
The onscroll event occurs when an element's scrollbar is being scrolled. Tip: use the CSS overflow style property to create a scrollbar for...
Read more >
Scroll Events and Intersection Observer - Beginner JavaScript
If it's the case of another element that has an overflow scroll set on it, like Wess has done in ... Even when...
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