Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion : configure a root margin on lazy turboframe intersection observer #1314

Open
johndodev opened this issue Sep 19, 2024 · 1 comment

Comments

@johndodev
Copy link

johndodev commented Sep 19, 2024

Hello,

Lazy frames are greats, but loaded only when the frame become visible. I could involve "bumps" when the content fill the frame (we can't always predict the content height before).

In the idea of https://www.stimulus-components.com/docs/stimulus-content-loader, is it possible to think about a way to configure a root margin for the observer ? So we could for example load a frame 50px before starting to be visible !

Ex : <turbo-frame id="turboid" src="..." loading="lazy" root-margin="50px">...</turbo-frame>

@pedroaugustofsilva
Copy link

Hi @johndodev.

This article shows how to do that with turbo frames.

It would be good to have it natively on Turbo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants