demarches-normaliennes/app/components/editable_champ/rna_component/rna_component.html.haml
simon lehericey 528b7ec3f8 refactor(champ): add required?
used for the `required` html attribute. It check visibility to avoid hidden required input which prevent the form from being sent.
2022-10-18 11:13:41 +02:00

12 lines
485 B
Text

= @form.text_field :value,
id: @champ.input_id,
aria: { describedby: @champ.describedby_id },
placeholder: t(".placeholder"),
data: { controller: 'turbo-input', turbo_input_url_value: champs_rna_path(@champ.id) },
required: @champ.required?,
pattern: "W[0-9]{9}",
title: t(".title"),
class: "width-33-desktop",
maxlength: 10
.rna-info{ id: dom_id(@champ, :rna_info) }
= render 'shared/champs/rna/association', champ: @champ, network_error: false, rna: @champ.value