cheatcode / joystick

A full-stack JavaScript framework for building stable, easy-to-maintain apps and websites.
https://cheatcode.co/joystick
Other
209 stars 11 forks source link

Fix re-render of same element in list taking on value of previous element in position #355

Closed rglover closed 2 months ago

rglover commented 11 months ago

In a list, if there are two list items with the same element (e.g., 1, 2, 3 each with a select dropdown), if item 1 is removed, elements in item 2 will retain the values of item 1.

This is because Joystick's DOM engine doesn't see a unique element, but rather, the same HTML element. The fix is to somehow uniquely identify elements in a list/loop/each so that when we re-render, the correct attributes are updated.

rglover commented 2 months ago

Done.