I have a custom element which displays a list of messages.
There is one iron-scroll-threshold
wrapping an iron-list
which has the task of loading new messages as the user scrolls down:
<div class="container">
<iron-scroll-threshold id="t" lower-threshold="500" on-lower-threshold="_ld">
<iron-list items="[[messages]]" as="m" scroll-target="t">
<template>
<div>
<!-- Messages markup here -->
</div>
</template>
</iron-list>
</iron-scroll-threshold>
</div>
That works fine.
I need a second kind of scroll-listener to mark messages as read as soon as they become visible (scrolled into the viewport). This should happen independently from loading new messages.
Is it possible to add a second iron-scroll-threshold
for that purpose or is there a better way to achieve that?
Edit
I have tried to put an on-content-scroll
on several elements but the event never get's fired.