eisneim/ngFlowGrid

Order of elements not preserved

Closed this issue · 10 comments

Hi,

I'm trying to use ngFlowGrid, and I have a problem with the first display.

If I display a list of elements, they are displayed in the wrong order at first. If I resize the window, then the order changes (all elements are displayed in the opposite order: first elements on the left).

Is it a bug, or is it something that I'm doing wrong ?

the order is left to right in each row, the last few of your item might in wrong order cause they will be used to fill in the shortest column to make sure each column is almost at same height.

Hello,

I created an example here (40 elements displayed) : http://jsbin.com/jijezuwonu
The code can be edited here: http://jsbin.com/jijezuwonu/edit?html,js

As you can see by yourself, and on the screen capture, elements are not in the correct order

capture d ecran 2015-06-30 a 23 23 48

If I resize the window, the display changes and now the order is right

capture d ecran 2015-06-30 a 23 24 33

Even if I go back to the original screen size, the order is preserved
capture d ecran 2015-06-30 a 23 25 18

@ghusse Yes, I reported the issue here before #3

At first time, I think maybe the calculation of height is done before the images loaded, which cause the issue at the first rendering. But it seems not, I'll review the code in my spare time, and try to make it right.

Thank you.

the only solution i have in mind is: provide a preload option, so when images are all loaded, will trigger a reflow; but the preload is some what unpredictable. what do you guys think? is there a better solution?

Why does it change anything? At the beginning as images are not loaded at
all, every element have approximatively the same height. Why it that case
the code decides to put them in the "wrong" order?

On Wed, Jul 1, 2015 at 2:34 PM, Eisneim Terry notifications@github.com
wrote:

the only solution i have in mind is: provide a preload option, so when
images are all loaded, will trigger a reflow; but the preload is some what
unpredictable. what do you guys think? is there a better solution?


Reply to this email directly or view it on GitHub
#5 (comment).

@ghusse i have no idea... i'll check it again when i got time from my work

Hello,

Any news about this? I still have this issue. This code could be really usefull but, because of this bug, I will not use it.

@ghusse sorry for my late reply, just too busy writing React.js app don't angular haven't got my attention, and this bug is fixed;

Great, thanks! I just tested and it works. :)