lustre-labs / lustre

A Gleam web framework for building HTML templates, single page applications, and real-time server components.
https://hexdocs.pm/lustre
MIT License
1.21k stars 78 forks source link

:bug: Fixed element.keyed children #183

Closed Billuc closed 2 months ago

Billuc commented 2 months ago

Fixed the problem where children of element.keyed elements would be added instead of the elements themselves.

It seems like the problem was a for-loop looping though the children of each child and adding them instead of the child itself when there were no keyed children.
I left the prevChild behaviour because I am not sure of how it works.
Also, I guess the for-loop was here for a reason, so I hope the change doesn't break anything. It does appear to fix the problem though

hayleigh-dot-dev commented 2 months ago

🫡 excellent investigation, seems like that for loop was there incorrectly so yeah I'm thinking this is the fix! Thanks.