fix(conditional): do not display empty div for invisible champs

This commit is contained in:
Eric Leroy-Terquem 2023-10-05 17:28:20 +02:00
parent 975baf5460
commit daa839ca82

View file

@ -6,7 +6,7 @@
- splitted_tail.each do |section, champ| - splitted_tail.each do |section, champ|
- if section.present? - if section.present?
= render section = render section
- else - elsif champ.visible?
= fields_for champ.input_name, champ do |form| = fields_for champ.input_name, champ do |form|
.fr-fieldset__element .fr-fieldset__element
= render EditableChamp::EditableChampComponent.new form:, champ: = render EditableChamp::EditableChampComponent.new form:, champ:
@ -18,7 +18,7 @@
- splitted_tail.each do |section, champ| - splitted_tail.each do |section, champ|
- if section.present? - if section.present?
= render section = render section
- else - elsif champ.visible?
= fields_for champ.input_name, champ do |form| = fields_for champ.input_name, champ do |form|
.fr-fieldset__element .fr-fieldset__element
= render EditableChamp::EditableChampComponent.new form:, champ: = render EditableChamp::EditableChampComponent.new form:, champ: