select2 Search is not working. Can you help me?
<select class="form-select" data-control="select2" data-hide-search="true" >
<option></option>
<option value="1">Option 1</option>
<option value="2">Option 2</option>
</select>
It doesn't work even though I loaded the requirements in the layout part
plugins.bundle.css
select2.init.js
plugins.bundle.js
app.js
Hi,
First of all, to work with Javascript you will need to use the source js for editing and gulp tools to compile it into the assets folder and your pages include the compiled js/css from the assets folder.
You can refer to this related post to work with Select2 Ajax.
Then recompile your assets folder with Gulp or Webpack.
Please note that the build tools are required only in the development environment just to compile the assets when the source folder files are modified. In the hosting/server deployment you will only need the compile assets, no need to install the build tools dependencies there.
Regards.