Stimulus Reflex drop down with selectize.js

542 Views Asked by At

I have a search form for an index page following the tabular demo. It works perfectly. The list I have that I want to filter by is quite long and I wanted to make it searchable so I added selectize.js, that piece also works just fine.

The problem is they don't work together. After selecting an item now it doesn't fire off the call to TabularReflex#search to filter the results.

#app/views/foo.index.html

<%= form_with scope: :search, url: '/search', html: { "data-reflex" =>"debounced:change->TabularReflex#search"} do |f| %>
  <%= f.select :foo, options_for_select(@search.foo), {include_blank: 'Select a Foo'}, {class: 'selectize'} %>
<% end %>

0

There are 0 best solutions below