Merge pull request #9501 from mfo/US/fix-commune-in-repetition
correctif(repetition.commune): ETQ usager, lorsque j'ai plus d'une repetition ayant un champ commune séléctionnée avec le meme code postal, les ids des options des input[type=radio] communes partageant le meme code postal ne sont pas uniques, on boucle donc sur la 1ere repetition quand on veut en selectionner un 🤯
This commit is contained in:
commit
6abd0f8db0
1 changed files with 2 additions and 2 deletions
|
@ -16,8 +16,8 @@
|
||||||
- commune_options.each.with_index do |(option, value), index|
|
- commune_options.each.with_index do |(option, value), index|
|
||||||
.fr-fieldset__element
|
.fr-fieldset__element
|
||||||
.fr-radio-group
|
.fr-radio-group
|
||||||
= @form.radio_button :value, value, checked: @champ.selected == value, id: index == 0 ? @champ.input_id : "radio-#{index}-#{value.parameterize}"
|
= @form.radio_button :value, value, checked: @champ.selected == value, id: "#{code_postal_input_id}-#{value.parameterize}"
|
||||||
= @form.label :value, option, for: index == 0 ? @champ.input_id : "radio-#{index}-#{value.parameterize}", class: 'fr-label'
|
= @form.label :value, option, for: "#{code_postal_input_id}-#{value.parameterize}", class: 'fr-label'
|
||||||
- else
|
- else
|
||||||
= @form.label :value, t('.commune').html_safe, for: @champ.input_id, class: 'fr-label'
|
= @form.label :value, t('.commune').html_safe, for: @champ.input_id, class: 'fr-label'
|
||||||
= @form.select :value, commune_options, commune_select_options, required: @champ.required?, id: @champ.input_id, aria: { describedby: @champ.describedby_id }, class: "width-33-desktop width-100-mobile fr-select"
|
= @form.select :value, commune_options, commune_select_options, required: @champ.required?, id: @champ.input_id, aria: { describedby: @champ.describedby_id }, class: "width-33-desktop width-100-mobile fr-select"
|
||||||
|
|
Loading…
Reference in a new issue