Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/Autocomplete/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@
``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`_.
See :ref:`_disabling-tom-select-plugins` for managing TomSelect plugins.

``options_as_html`` (default: ``false``)
Set to ``true`` if your options (e.g. ``choice_label``) contain HTML. Not
Expand Down Expand Up @@ -415,6 +416,24 @@
You *can* add autocompletion to this via the ``autocomplete_url`` option - but you'll
likely need to create your own :ref:`custom autocomplete endpoint <custom-autocomplete-endpoint>`.

.. _disabling-tom-select-plugins:

Check failure on line 419 in src/Autocomplete/doc/index.rst

View workflow job for this annotation

GitHub Actions / DOCtor-RST

Please add a blank line after the anchor ".. _disabling-tom-select-plugins:"
Disabling TomSelect plugins

Check failure on line 420 in src/Autocomplete/doc/index.rst

View workflow job for this annotation

GitHub Actions / DOCtor-RST

Please ensure title "Disabling TomSelect plugins" and underline length are matching
--------------------------

You can disable default plugins using ``tom_select_options.plugins``::

$resolver->setDefaults([
'class' => Ingredient::class,
'tom_select_options' => [
'plugins' => [
'clear_button' => false, // Disable the clear button
'remove_button' => false, // Disable the remove button
],
],
]);

See TomSelect plugins documentation : https://tom-select.js.org/plugins

Customizing the AJAX URL/Route
------------------------------

Expand Down