Odd flow panel behaviour part 1

I’ve just tried filling up a flow panel with links, and once I get to 8 weird things start to happen.

This is the first of the (see gif below). I cannot add any more links after 8. Nothing happens when I try (this is all in the IDE by the way, I’ve not tried programmatically).

Once I hit the limit, the 8th element seems to be un-selectable. Then suddenly it swaps itself out for one I’d previously tried to add to the end, as if there was a massive (1-2 minute) delay to my drag-drop action. Then selecting that link highlights the link below it. I’m not explaining it well - take a look at the gif and it might make more sense.

Link to the app if it helps any :

https://anvil.works/build#clone:MYQGJCNUKTW6MKJX=JQWYNWGGHOABOY2KNYCR3AAS

In my version of the code you managed to have two links named link_1_copy_7 which I think is causing problems… One of which is your link that has the text attribute d. So I think that is causing the weird behaviour rather than the flow panel…

Yeah, I reckon that might be it as well.

As they were auto named by the IDE, I guess that’s another issue to add - duplicate control names when cutting and pasting :slight_smile:

yeah it’s weird - normally it doesn’t let you use duplicate names… I wonder how that happened.

Would you be able to try adding more links to the flow panel in your cloned version?

In my version it just ignores my attempts beyond 7. I recon that’s when the component got double named (possibly).

Yeah after I delete the d link_1_copy_7 then it works as expected… I can add the other elements to the flow panel. Wrapping to the next row when the space available is filled.

I never reported it because I wasn’t able to reproduce it, but long time ago I had duplicated names on a form. I couldn’t figure out how it happened, could have been copy and paste, drag and drop, undo, who knows.

I pulled to a local git repository, dug into the yaml files and found out that there were duplicated names. I fixed the yaml (and since I was there I did some mass change of properties, something like changing the alignment of all the component of a form in one shot), committed, pushed, and it was fixed.

Yep - can’t make it go wrong now.

Ok, well at least Anvil Central have a broken project to clone to see two elements coexisting with the same name.

But as to how it got in that state, I can’t reproduce.

Thanks @stefano.menci & @stucork