Add default value for max_items_selected

This commit is contained in:
jf-cbd
2025-11-26 18:03:26 +01:00
parent a0f28f725c
commit 6aabed3063
2 changed files with 2 additions and 2 deletions

View File

@@ -19,7 +19,7 @@ class TomSelectElement extends HTMLSelectElement {
if (this.getAttribute('data-tom-select-disable-auto-complete')) {
options.controlInput = null;
}
if (this.getAttribute('data-tom-select-max-items-selected')) {
if (this.getAttribute('data-tom-select-max-items-selected') && this.getAttribute('data-tom-select-max-items-selected') !== '') {
options.maxItems = parseInt(this.getAttribute('data-tom-select-max-items-selected'));
}
if (this.getAttribute('data-tom-select-placehelder')) {

View File

@@ -36,7 +36,7 @@ class ChoiceFormType extends AbstractType
// options to control the inline display of choices
$resolver->setDefault('inline_display', true);
$resolver->setDefined('max_items_selected');
$resolver->setDefault('max_items_selected', '');
$resolver->setDefault('disable_auto_complete', true);
}