fix: always add an empty option in mandatory

This commit is contained in:
simon lehericey 2023-05-02 13:19:04 +02:00
parent 253ddc56e2
commit 9e0aadd2dd
2 changed files with 7 additions and 9 deletions

View file

@ -19,7 +19,13 @@
%label.fr-label{ for: "#{@champ.id}_radio_option_other" }
Autre
- else
= @form.select :value, @champ.options_without_empty_value_when_mandatory(@champ.options), { selected: @champ.selected }, required: @champ.required?, id: @champ.input_id, class: select_class_names, aria: { describedby: @champ.describedby_id }
= @form.select :value,
@champ.options.compact_blank,
{ selected: @champ.selected, include_blank: true },
required: @champ.required?,
id: @champ.input_id,
class: select_class_names,
aria: { describedby: @champ.describedby_id }
- if @champ.drop_down_other?
= render EditableChamp::DropDownOtherInputComponent.new(form: @form, champ: @champ)