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
window.dispatchEvent(new Event('resize')) causing infinite loop #2
Comments
This has been fixed now :-) |
No longer triggering resize event |
The changes actually trigger a weird behaviour for me. The height or the wrapper isn't calculated the same way, it gets doubled for some reason. Trying to see what could be causing it but it could be good to know that the change had an unforeseen outcome. |
Re-adding the line "this.masonry.reloadItems();" in componentWillReceiveProps seems to fix the problems I'm seeing. |
@Chrazy Will look into it straight away :-) |
Hope you manage to reproduce my findings. Quick response time! |
Pushed new version (0.5.3 on npm) with the proposed fix. please test and report back if you have time :-) |
Seems to do the trick for me at least :) |
@Chrazy great :-) nothing else seems to break, and the addition makes sense. |
I actually ran in to the same problem once again in some cases. I haven't had time to set up small case to reproduce it but reverting back to 0.4 fixes the problem for now. Should create a new issue when someone else runs into it as it's not really part of this one. |
It still happens with 0.5.3? Hmm.. what actually happens? |
The wrapper containing the blocks gets it's height doubled, so all the blocks gets pushed down. |
It seems to be something that happens when the number of blocks are odd (I know, odd right...). I'll dig a bit more to see which commit that caused it. |
Seems like 0.5 was the commit that caused the double height actually. |
@Chrazy It would be great with a demo case that causes this, so I can test. I can't seem to reproduce it |
One of my masonry's parent components is listening to the
resize
event, causing thecomponentDidUpdate
of the mixin to fire, causing theresize
listener to fire again..I'm fixing this now by doing:
in the masonry element.
But I think this could cause issues for other users as well.
I'm not sure how to prevent this in the mixin, other than triggering update on masonry manually...
The text was updated successfully, but these errors were encountered: