OK for Tom Select

This commit is contained in:
jf-cbd
2025-11-26 12:03:03 +01:00
parent 02650f8cf7
commit a0f28f725c
3 changed files with 10 additions and 6 deletions

View File

@@ -25,10 +25,10 @@
{% set attr = attr|merge({class: (attr.class|default('') ~ ' ibo-input')|trim}) %}
<select is="tom-select-element" class="field_autocomplete ibo-input ibo-input-select ibo-input-select-autocomplete ui-autocomplete-input"
{{ block('widget_attributes') }}
{% if multiple %} multiple="multiple" data-tom-select-multiple="true" {% endif %}
{% if max_items_selected is defined %} data-tom-select-max-items="{{ max_items_selected }}" {% endif %}
{% if placeholder is defined %} data-tom-select-placeholder="{{ placeholder }}" {% endif %}
{% if disable_input is defined%} data-tom-select-disable-control-input=true {% endif %}
{% if multiple %} multiple="multiple" {% endif %}
{% if max_items_selected is defined %} data-tom-select-max-items-selected="{{ max_items_selected }}" {% endif %}
{% if disable_auto_complete %} data-tom-select-disable-auto-complete=true {% endif %}
{% if placeholder is not none %} hidePlaceholder=false {% endif %}
>
{%- if placeholder is not none -%}
<option value=""{% if placeholder_attr|default({}) %}{% with { attr: placeholder_attr } %}{{ block('attributes') }}{% endwith %}{% endif %}{% if required and value is empty %} selected="selected"{% endif %}>{{ placeholder != '' ? (translation_domain is same as(false) ? placeholder : placeholder|trans({}, translation_domain)) }}</option>