caluire: fix widget on child change (#74722) #176

Merged
lguerin merged 1 commits from wip/74722-caluire-fix-widget into main 2023-02-21 18:41:05 +01:00
1 changed files with 3 additions and 0 deletions

View File

@ -37,7 +37,10 @@
<div class="activity-label"/>
<label>
<input
{# never displayed, no possible changes to not overwrite #}
{% if not widget.value and option.options.prefill %}checked="checked"{% endif %}
{# already displayed but for another child #}
{% if widget.value and widget.value|first|split:':'|first != last_option.value|split:':'|first and option.options.prefill %}checked="checked"{% endif %}
{% if option.selected %}checked="checked"
{% elif widget.readonly or option.disabled %}disabled{% endif %}
{% for attr in widget.attrs.items %}{{attr.0}}="{{attr.1}}"{% endfor %}