I'm having an issue where my radio buttons (view) get out of sync with my model (reactive form) when the same label exists in subsequent questions.
I'm creating some kind of survey app which (of course) contains multiple questions, but when 2 subsequent questions contain the same answer labels in different positions, the view gets out of sync when selecting one of them and navigating between the 2 questions. I've created a Stackblitz to illustrate the issue. (Same Stackblitz without Material)
Reproduction steps wrong selection:
- Select the second option for question 1 ('MRX').
- Click the 'Next' button (answer gets stored in model).
- Select the second option again for question 2 ('Ibanez').
- Click the 'Previous' button (answer gets stored in model).
- Click the 'Next' button again.
- Now you can see that the view is out of sync with the model (the model is also printed on screen).
Reproduction steps double selection:
- Select the first option for question 1 ('Ibanez').
- Click the 'Next' button (answer gets stored in model).
- Select the second option for question 2 ('Inbanez').
- Click the 'Previous' button (answer gets stored in model).
- Now you can see that 2 options are selected (first and second).
For more information on the app I've added a description in the parent component (survey-parent.component.html) of the stackblitz.
I'm not sure if this is a bug in Angular or that I am doing something wrong here.