You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way to get turboframe to append elements to an existing turboframe? If not, this might be a useful feature. Of course, if I'm missing how to do this, please let me know.
I'm using lazy loading of turboframe as an infinite pager with lazy loading. It works great. But to the downside is that it can't put the new elements in the same container. That's a big downside in that it prevents useful layout options I'd like to take advantage of.
To give some more specificity, each page is setup like this:
<turbo-frame id="__pagination{{ $pagenumber }}" target="_top>
{{ ELEMENTS FOR THIS PAGE }}
</turbo-frame>
<turbo-frame id="__pagination{{ $nextpagenumber }}" src="{{ $nextpageurl }}" loading=lazy data-turbo-action="advance" target="_top">
</turbo-frame>
Or...
<turbo-frame id="__pagination{{ $pagenumber }}" target="_top>
{{ ELEMENTS FOR THIS PAGE }}
<turbo-frame id="__pagination{{ $nextpagenumber }}" src="{{ $nextpageurl }}" loading=lazy data-turbo-action="advance" target="_top">
</turbo-frame>
</turbo-frame>
On infinite scroll, the next items fill in the place holder like this:
<turbo-frame id="__pagination{{ $pagenumber }}" target="_top>
{{ ELEMENTS FOR THIS PAGE }}
</turbo-frame>
<turbo-frame id="__pagination{{ $nextpagenumber }}" src="{{ $nextpageurl }}" loading=lazy data-turbo-action="advance" target="_top">
{{ ELEMENTS FOR NEXT PAGE }}
</turbo-frame>
<turbo-frame id="__pagination{{ $nextnextpagenumber }}" src="{{ $nextnextpageurl }}" loading=lazy data-turbo-action="advance" target="_top">
</turbo-frame>
So...is there a way to have setup so it fills in like this?
<turbo-frame id="__pagination{{ $pagenumber }}" target="_top>
{{ ELEMENTS FOR THIS PAGE }}
{{ ELEMENTS FOR NEXT PAGE }}
</turbo-frame>
<turbo-frame id="__pagination{{ $nextnextpagenumber }}" src="{{ $nextnextpageurl }}" loading=lazy data-turbo-action="advance" target="_top">
</turbo-frame>
Of course, where the turboframe to the next page lands is not important in the end, because it is a hidden element.
The text was updated successfully, but these errors were encountered:
Hi @swamidass, there's no plan to add this at least for now. In this particular case, you would be better off using a Turbo stream to solve this. You can even include Turbo streams inside the response if it is inside a Turbo frame, so that you still have the lazy loading. Closing this for now
Is there a way to get turboframe to append elements to an existing turboframe? If not, this might be a useful feature. Of course, if I'm missing how to do this, please let me know.
I'm using lazy loading of turboframe as an infinite pager with lazy loading. It works great. But to the downside is that it can't put the new elements in the same container. That's a big downside in that it prevents useful layout options I'd like to take advantage of.
To give some more specificity, each page is setup like this:
Or...
On infinite scroll, the next items fill in the place holder like this:
So...is there a way to have setup so it fills in like this?
Of course, where the turboframe to the next page lands is not important in the end, because it is a hidden element.
The text was updated successfully, but these errors were encountered: