do not prepend if already reloading #130
Open
+13
−7
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.
Hello!
I really appreciate the work done for this component, so thank you!
I found a positioning issue with a particular use case I have. I am prepending items to the masonry layout while maintaining the position/index of some existing items. I am not using the 'stamp' option of masonry in order to still utilize the layout/positioning logic for the 'stuck' items.
Here is a simplified example of the issue:
https://codesandbox.io/s/m5888np119
If you click 'prepend' you will see the positioning issue. The turquoise item should be kept in place. I would like the end result for the example to look like this after prepending one item:

If a child of the masonry layout has an image, I have seen the issue be resolved most of the time by the
layout
call in the images loaded callback, but not always.Didn't see the need to prepend the new item(s) when items are already being reloaded before a layout call. Let me know what you think of the change. :)