htmx: Endless scrolling via "revealed" does not work

I want to use htmx hx-trigger="revealed" to implement endless scrolling.

I send this html to the browser. In this case Note-20 should load the next note (Note-19):

    <h1 class="">Note-20</h1>
    <p class="">foo</p>
    <div hx-get="/note/19/" hx-trigger="revealed" hx-swap="outerHTML" class=""></div>

The URL /note/19/ returns roughly the same HTML: it contains the data of Note-19 and at the end it tells the browser to load Note-18 on "revealed".

This works for the first notes. But then it stops.

What could be the reason?

110 thoughts on “htmx: Endless scrolling via "revealed" does not work”

Leave a Comment