diff --git a/app/components/dsfr/input_errorable.rb b/app/components/dsfr/input_errorable.rb index 294c2cd27..b5f1a7d94 100644 --- a/app/components/dsfr/input_errorable.rb +++ b/app/components/dsfr/input_errorable.rb @@ -22,10 +22,17 @@ module Dsfr end def input_group_error_class_names - { - "fr-input-group--error": errors_on_attribute?, - "fr-input-group--valid": !errors_on_attribute? && errors_on_another_attribute? - } + if @champ && @champ.legend_label? + { + "fr-fieldset--error": errors_on_attribute?, + "fr-fieldset--valid": !errors_on_attribute? && errors_on_another_attribute? + } + else + { + "fr-input-group--error": errors_on_attribute?, + "fr-input-group--valid": !errors_on_attribute? && errors_on_another_attribute? + } + end end def input_error_class_names