I have an iron-list
which I add new items to while scrolling to the bottom using iron-scroll-threshold
. That works fine.
What I also need is a general event which is fired when scrolling stops.
I need that to know whether the listed items (m.message) have been seen by the user, by checking which items are currently visible in the view-port after scrolling, and then marking them as "read".
<div class="container" on-content-scroll="_scrollHandler">
<iron-scroll-threshold id="threshold" scroll-target="mlist" lower-threshold="500" on-lower-threshold="_loadMoreData"></iron-scroll-threshold>
<iron-list items="[[messages]]" id="mlist" as="m">
<template>
<div>
<p>[[m.message]]</p>
</div>
</template>
</iron-list>
</div>
The handler _scrollHandler
is never fired however.
What would be necessary to get an event after scrolling ends?
It works at the end by moving
on-scroll="_scrollHandler"
to theiron-list
:With the function being:
Edit:
In case the
iron-scroll-threshold
wraps theiron-list
, you need to moveon-scroll
to theiron-scroll-threshold
-element: