Funny I just recently was using similar thing as an Example here Afterthoughts around about Kernel code and custom operators complaints
Since @wolfadex already did pretty good job in explaining how to solve it I just add more technical note. This is not really problem with Elm, this is problem with VirtualDom diffing in general. React, Vue and other will suffer from similar issues without keyed node.