-
Notifications
You must be signed in to change notification settings - Fork 148
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 scrolling props.parent instead of on window only #10
Conversation
Cool! Curious what your use case is? Also why checkin the compiled code? |
Hey would love to commit this. Please just remove the checked-in dist stuff. |
Also, another question—why make parent a function? Does the parent element change often with react-infinite? |
Updated ;-) No, it's not changed. |
Thanks! And if you could squash it down to one commit as well everything
|
done |
parent has to be a function, we should bind a listener to an existing dom node |
Why does parent have to be a function? |
@borisnadion bumping this, would love to commit this. Why again does |
< ScrollableContent ref="scrollable" ...> because the parent, or actually just source DOM element for measurements can actually be not parent at all, for example position=fixed elements inside scrollable ones look bad on iOS Safari: they're scrolled with a content and then jump to maintain fixed position when scroll is ended |
Allows you to treat the element as a deferred value, i guess. Is there a danger of memory leaks due to not cleaning up your event handlers, if the element you listen to can change at any moment? |
@@ -17,6 +17,7 @@ module.exports = React.createClass | |||
ticking: false | |||
|
|||
propTypes: | |||
parent: React.PropTypes.node |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parent should always be a function right? so React.PropTypes.func
?
Cool :) makes sense. If you could rebase and address the question I raised, let's get this merged and in a new release. |
Did you see my comment above regarding memory leaks and event listeners? |
@WickyNilliams I did—not sure I understand—if the parent element is removed—wouldn't the event listeners get GCed? |
Older IE will (React supports back to IE8). But I guess that's not such a priority these days haha. Stuck in my old ways :) |
Is there anything you need help with? I’d also need this feature in a project I’m working on. :-) |
Released 1.7.0 w/ this PR included! Thanks @borisnadion! |
usefull for https://github.com/seatgeek/react-infinite/
related to seatgeek/react-infinite#47