How to use Sprig to filter categories using a dropdown I'm having an issue where I'm adding a dropdown to my search to filter through the first parent attribute in a category (Winter 2020, Spring 2021, and so on). The search field works, but nothing happens if I select from the dropdown (Winter 2020).
What am I missing?
{% set search = search ?? ''%}
{% set category = category ?? ''%}

{% set entryQuery = craft.entries ({
    search: search,
    section: 'articles',
    limit: 2, 
    }) %}


{% set myCategoryQuery = craft.categories ({
    group: 'edition', 
    level: 1,
    }) %}

{% set entries = entryQuery.all() %}
{% set categories = myCategoryQuery.all() %}



&lt;div s-replace=&quot;#board&quot;&gt;
&lt;form&gt;
    &lt;input sprig s-trigger=&quot;keyup changed delay:200ms&quot; id=&quot;search&quot; name=&quot;search&quot; value=&quot;{{ search }}&quot; type=&quot;text&quot; placeholder=&quot;Search&quot; autocomplete=&quot;off&quot;&gt;
    &lt;select sprig name=&quot;category&quot; id=&quot;category&quot; value=&quot;{{ category }}&quot; class=&quot;form-control&quot;&gt;
      &lt;option value=&quot;&quot;&gt;Any&lt;/option&gt;
        {% for category in categories %}
          &lt;option value=&quot;{{ category }}&quot;&gt;{{ category }}&lt;/option&gt;
        {% endfor %}
    &lt;/select&gt;
  &lt;/form&gt;

    &lt;div id=&quot;board&quot;&gt;
        {% for entry in entries %}
        &lt;div class=&quot;mt-4 mb-4&quot;&gt;
          {% for category in entry.edition.all()%}
            &lt;strong&gt; {{ category }}&lt;/strong&gt;
          {% endfor %}
          &lt;div&gt;{{entry.title}}&lt;/div&gt;
          {% for category in entry.authors.all() %}
          {{ category.title }},
          {% endfor %}
        &lt;/div&gt;
        {% endfor %}
        {% if entries|length == 0 %}
      &lt;div&gt;No entries found &lt;/div&gt;
        {% endif %}
        &lt;div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
You need to apply the category filter to the entry query.
{% set categoryId = categoryId ?? '' %}

{% set entryQuery = craft.entries ({
    search: search,
    section: 'articles',
    limit: 2,
    relatedTo: categoryId,
}) %}

And also update the select field to match.
    &lt;select sprig name=&quot;categoryId&quot; id=&quot;category&quot; value=&quot;{{ categoryId }}&quot; class=&quot;form-control&quot;&gt;
      &lt;option value=&quot;&quot;&gt;Any&lt;/option&gt;
        {% for category in categories %}
          &lt;option value=&quot;{{ category.id }}&quot;&gt;{{ category }}&lt;/option&gt;
        {% endfor %}
    &lt;/select&gt;

See the Sprig filters video for an explanation of how to output and use categories as filters:
https://putyourlightson.com/sprig/videos#sprig-filters