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

rootMargin only works on initial load #157

Closed
RobbieTheWagner opened this issue Sep 22, 2016 · 5 comments
Closed

rootMargin only works on initial load #157

RobbieTheWagner opened this issue Sep 22, 2016 · 5 comments

Comments

@RobbieTheWagner
Copy link

I am trying to use rootMargin: 2000px 2000px 2000px 2000px to load content that is off of the screen, so a few results above and below the containing div should be loaded. This works on initial load, and there are several loaded in results, but when I scroll back up everything has disappeared, so it seems that the rootMargin only works on initial load. I am showing and hiding my content doing something like this:

const observer = new IntersectionObserver(([entry]) => {
      // If intersectionRatio <= 0 it is hidden
      run(() => {
        this.set('viewportEntered', entry.intersectionRatio > 0);
      });
    }, options);

Is entry.intersectionRatio > 0 what I want here? If so, something seems to be not working correctly.

@philipwalton
Copy link
Member

Can you clarify whether this is for the polyfill or the native implementation (or both)?

@RobbieTheWagner
Copy link
Author

@philipwalton I am not sure. The issue was in Chrome, so I assume it would have used the native one, but I am including the polyfill.

@szager-chromium
Copy link
Collaborator

Can you please verify that this is a bug in the native implementation by trying it without including the polyfill?

If it's a bug in the native implementation, then please file a bug (with a reproduction) at crbug.com.

@honsa
Copy link

honsa commented Mar 27, 2018

@miketaylr
Copy link
Member

miketaylr commented Jun 9, 2022

Right, it is read-only, so this is working as expected. Someone else filed a similar feature request to make this settable at #490, so let's close this in favor of that.

edit: #428 is probably what we want to dupe against.

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

No branches or pull requests

5 participants