-
Notifications
You must be signed in to change notification settings - Fork 247
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
Infinite loop in _renderGrid #1
Comments
I was able to reproduce the issue as well, by simply making my browser window fairly narrow (approximately the size of a smartphone in landscape orientation). I didn't make any changes to the code to increase the size of the boxes as nested generates them, although I see where this can be accomplished in _setBoxes(). I was also able to trace the source of the infinite loop as the while loop in _renderGrid(). |
Looks like the condition that creates the infinite loop occurs when the viewport is reduced to less than the size of the widest element in the grid. |
This seems to occur when I've fixed this locally by adding the following code before the
|
This sorts out another issue where if minWidth was larger than 242px I would get the same infinite loop / break. |
Started using https://github.com/metafizzy/packery as an alternative |
Try as explained here. |
I was able to make both Chrome and Safari freeze.
Steps to reproduce
box.className = 'box size' + Math.ceil( Math.random()*3 ) + Math.ceil( Math.random()*3 );
to
box.className = 'box size' + Math.ceil( Math.random()*15 ) + Math.ceil( Math.random()*15 );
in makeboxes.js
_renderGrid seems to loop
I'm guessing one of the for-loops within the
while(true){}
never breaks.Maybe I shouldn't make that big boxes?
But there should be some nice fallback, right?
The text was updated successfully, but these errors were encountered: