Skip to content

Conversation

@michaelkhabarov
Copy link

This PR introduces the data-turbo-lazy-root-margin attribute for turbo-frame.
The value is passed to the IntersectionObserver in AppearanceObserver as the rootMargin option.

The purpose of this option is to trigger lazy frame loading slightly before the user scrolls to the element. This improves user experience by making the site feel more responsive.

Currently, we are using a custom Stimulus controller with its own IntersectionObserver to achieve the same effect.

@michaelkhabarov
Copy link
Author

@brunoprietog Hi! Could you please review this when you have a moment?
It's a fairly small and straightforward change, and would be quite useful for us. Thank you!

@qichunren
Copy link

This PR is very good!

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants