chore(form): don't try to put invalid group classes for non fillable inputs

This commit is contained in:
Colin Darie 2023-09-28 17:36:45 +02:00
parent 60882e0844
commit 95ceee38c7
No known key found for this signature in database
GPG key ID: 8C76CADD40253590

View file

@ -11,12 +11,14 @@ module Dsfr
def dsfr_group_classname
if dsfr_champ_container == :fieldset
'fr-fieldset'
else
elsif dsfr_input_classname.present? # non fillable element
"#{dsfr_input_classname}-group"
end
end
def input_group_error_class_names
return {} if dsfr_group_classname.nil?
{
"#{dsfr_group_classname}--error" => errors_on_attribute?,
"#{dsfr_group_classname}--valid" => !errors_on_attribute? && errors_on_another_attribute?