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 passing new props to updateInitialDimension #34

Merged

Conversation

codeheroics
Copy link
Contributor

When componentWillReceiveProps happens it callsupdateInitialDimension to get new dimensions.

However, to calculate these new dimensions, updateInitialDimension calls getTopPosition and getBottomBoundary, which both read information from the old props.

This PR allows an optional object to be passed to updateInitialDimension so the new props values can be given to the other functions.

Verified

This commit was signed with the committer’s verified signature.
vbudhram Vijay Budhram
@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 97.253% when pulling ffdd783 on codeheroics:pass-new-props-to-updateInitialDimension into ac2df57 on yahoo:master.

@yahoocla
Copy link

Thank you for submitting this pull request, however I do not see a valid CLA on file for you. Before we can merge this request please visit https://yahoocla.herokuapp.com/ and agree to the terms. Thanks! 😄

@yahoocla
Copy link

CLA is valid!

@hankhsiao
Copy link
Contributor

So you really have a use case that you will dynamically change Sticky props? Can you elaborate your case, so I can have broader view to check all logic.

@codeheroics
Copy link
Contributor Author

Yes, I've got the problem with an infinite scroll.

When scrolling down, I need to set a bottomBoundary to the current position of a footer element. When scrolling, if bottomBoundary isn't updated fast enough (eg. when I give new props to react-stickynode, which causes it to recalculate its dimensions with the previous props), my sticky sidebar ends up scrolling up, since these dimensions weren't correctly updated. Then, when the dimensions are finally correctly updated, the sidebar jumps back to its position at the bottom of the page, leading to a quite displeasant effect.

@hankhsiao
Copy link
Contributor

Sorry for the late response. It looks good 👍

@kaesonho
Copy link
Contributor

kaesonho commented May 2, 2016

👍

@kaesonho kaesonho merged commit 18ece24 into yahoo:master May 2, 2016
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

Successfully merging this pull request may close these issues.

None yet

5 participants