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

Allow for full IntersectionObserver options to be passed in? #18

Closed
tizmagik opened this issue Jun 27, 2017 · 6 comments
Closed

Allow for full IntersectionObserver options to be passed in? #18

tizmagik opened this issue Jun 27, 2017 · 6 comments

Comments

@tizmagik
Copy link

tizmagik commented Jun 27, 2017

First, thanks for the component, this is great!

I wanted to ask if the full options of IntersectionObserver API could be passed in? Right now it looks like only { threshold } is passed in, so it's missing the other options, like root and rootMargin.

Was this a deliberate decision? If not, would you accept a PR adding in the other options?

@thebuilder
Copy link
Owner

Hey - I didn't need to use the other options, so never got around to adding it. It makes sense to add them, but i guess it requires some work.

Right now i'm using the threshold to handle the instance creation of IntersectionObserver - It would need to take all the options into account.

@DannyLingard
Copy link

Hey just stumbled across this as looking to implement an infinite scroller for an ancestor element. Are you intending to add root option or awaiting a PR from @tizmagik?

@thebuilder
Copy link
Owner

thebuilder commented Aug 4, 2017 via email

@thebuilder
Copy link
Owner

Fixed in #21 and released as version 1.0.0

@thebuilder
Copy link
Owner

@tizmagik and @DannyLingard - Try out these new options if you have a chance. Would like to know if there are any issues, when you make an actual implementation.

@DannyLingard
Copy link

DannyLingard commented Aug 7, 2017

@thebuilder Thanks for the update, I'm about a week or so away from implementing but will keep you posted. Use case: I'm developing an enterprise dashboard where the user can have 1000+ search results, which are displayed in a dropdown (hence need for root). Each result is also a collapse, displaying related data when expanded. I'm hoping I can use this as an alternative to react-virtualized for infinite scrolling as I'm catering to evergreen browsers.

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

3 participants