Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Elm and Radio button wonkiness

Tags:

elm

I've been creating a survey with elm that uses radio buttons for different questions. Users can click back and forth between questions and select different radio options. However, I get some wonky behavior if the user backtracks through the survey.

If you make some selections, click "next question" make a couple of selections and click "previous question" the previous selections you made "disappear"

I've created an example that you can view on Ellie.

like image 810
Kurt Mueller Avatar asked Apr 25 '18 19:04

Kurt Mueller


2 Answers

I eventually fixed this by doing what Matthew Stevenson and Hal suggested in the comments of my question: use Elm's Html.Keyed library. I eventually ended up keying my table rows tr which seems to have fixed the problem.

Here is the Updated Ellie

like image 67
Kurt Mueller Avatar answered Oct 09 '22 00:10

Kurt Mueller


Interestingly enough.. this is a BootStrap issue. Try removing the reference to bootstrap, and try to replicate the bug. It goes away, I remember having the same issue with a previous project. Hopefully this helps!

like image 23
JosephStevens Avatar answered Oct 09 '22 00:10

JosephStevens