This repository was archived by the owner on Jun 10, 2020. It is now read-only.
Loading items on container height dynamically changed#192
Open
bsalex wants to merge 3 commits intoseatgeek:masterfrom
Open
Loading items on container height dynamically changed#192bsalex wants to merge 3 commits intoseatgeek:masterfrom
bsalex wants to merge 3 commits intoseatgeek:masterfrom
Conversation
Author
|
Ping |
Author
|
Do you have any objections? |
DevSide
suggested changes
May 11, 2017
| this.onInfiniteLoad(); | ||
| } | ||
|
|
||
| if (this.props.containerHeight !== prevProps.containerHeight) { |
There was a problem hiding this comment.
containerHeight is computed in generateComputedProps so you can't get the previous value by this way
|
|
||
| if (this.props.containerHeight !== prevProps.containerHeight) { | ||
| const scrollTop = this.utils.getScrollTop(); | ||
| const newApertureState = infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(this.state, scrollTop); |
There was a problem hiding this comment.
You may rely on handleScroll for the rest ?
Author
There was a problem hiding this comment.
Yes, thanks, it is much simpler now
| expect(infiniteSpy).not.toHaveBeenCalled(); | ||
| }); | ||
|
|
||
| it('triggers the onInfiniteLoad function when containerHeight changes', function() { |
There was a problem hiding this comment.
you may provide the case where useWindowAsScrollContainer is true so when containerHeight changes, onInfiniteLoad is not called
…containerHeight value source.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In my case, the container size is not fixed and is changed according to page size (flexible markup).
The problem appears when the page is resized without scroll events on
react-infinitecomponent, it leads to empty space below previously loaded requests. The PR fixes it.The PR includes tests.