From 4053ec7665d253015072164226a0d81bb8a151c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Geffroy?= <81738559+raphael-geffroy@users.noreply.github.com> Date: Thu, 18 Sep 2025 17:48:50 +0200 Subject: [PATCH 1/3] docs: document possibility to disable tomselect default plugins --- src/Autocomplete/doc/index.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Autocomplete/doc/index.rst b/src/Autocomplete/doc/index.rst index 972479d7fe3..39e3307c067 100644 --- a/src/Autocomplete/doc/index.rst +++ b/src/Autocomplete/doc/index.rst @@ -206,6 +206,19 @@ e.g. ``FoodAutocompleteField`` from above): ``tom_select_options`` (default: ``[]``) Use this to set custom `Tom Select Options`_. If you need to set an option using JavaScript, see `Extending Tom Select`_. + You can disable default plugins using ``tom_select_options.plugins`` + + ```php + $resolver->setDefaults([ + 'class' => Ingredient::class, + 'tom_select_options' => [ + 'plugins' => [ + 'clear_button' => false, // Disable the clear button + 'remove_button' => false, // Disable the remove button + ], + ], + ]); + ``` ``options_as_html`` (default: ``false``) Set to ``true`` if your options (e.g. ``choice_label``) contain HTML. Not From 0b5eb1a7d3ca0c00bdf7c6d2be57ff94b991c7bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Geffroy?= <81738559+raphael-geffroy@users.noreply.github.com> Date: Thu, 18 Sep 2025 17:51:24 +0200 Subject: [PATCH 2/3] fix doc --- src/Autocomplete/doc/index.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Autocomplete/doc/index.rst b/src/Autocomplete/doc/index.rst index 39e3307c067..7d6e49c3071 100644 --- a/src/Autocomplete/doc/index.rst +++ b/src/Autocomplete/doc/index.rst @@ -208,7 +208,6 @@ e.g. ``FoodAutocompleteField`` from above): an option using JavaScript, see `Extending Tom Select`_. You can disable default plugins using ``tom_select_options.plugins`` - ```php $resolver->setDefaults([ 'class' => Ingredient::class, 'tom_select_options' => [ @@ -218,7 +217,6 @@ e.g. ``FoodAutocompleteField`` from above): ], ], ]); - ``` ``options_as_html`` (default: ``false``) Set to ``true`` if your options (e.g. ``choice_label``) contain HTML. Not From f2406849e6aceb65f88d085487cdcf41672d3805 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Geffroy?= <81738559+raphael-geffroy@users.noreply.github.com> Date: Thu, 18 Sep 2025 17:53:04 +0200 Subject: [PATCH 3/3] fix doc --- src/Autocomplete/doc/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Autocomplete/doc/index.rst b/src/Autocomplete/doc/index.rst index 7d6e49c3071..cca374fa06a 100644 --- a/src/Autocomplete/doc/index.rst +++ b/src/Autocomplete/doc/index.rst @@ -206,7 +206,7 @@ e.g. ``FoodAutocompleteField`` from above): ``tom_select_options`` (default: ``[]``) Use this to set custom `Tom Select Options`_. If you need to set an option using JavaScript, see `Extending Tom Select`_. - You can disable default plugins using ``tom_select_options.plugins`` + You can disable default plugins using ``tom_select_options.plugins``:: $resolver->setDefaults([ 'class' => Ingredient::class,