caluire: fix widget on child change (#74722)
gitea/publik-base-theme/pipeline/head This commit looks good Details

This commit is contained in:
Lauréline Guérin 2023-02-21 17:46:38 +01:00
parent a9c19ac509
commit 3fd17ba107
No known key found for this signature in database
GPG Key ID: 1FAB9B9B4F93D473
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 %}