title: How to make the Shopify collections sort by option show the selected value? It goes back to the default 'Sort By' after loading
body: <p>When a user clicks on an option e.g. <strong>Price, low to high</strong> - the page refreshes but the select dropdown goes back to default which says "Sort by" instead of showing Price, low to high. Is there a way to make it show that the <strong>Price, low to high</strong> is currently selected?</p>
  
  <p>Currently, my code is:</p>
  
  <pre><code>&lt;div class="collection-sorting styled-select mr3-l mb2-l"&gt;
    {%- assign selected = collection.sort_by | default: collection.default_sort_by -%}
    &lt;select name="sort_by" onchange="location = this.value;" id="sorting"&gt;
  
      &lt;option value="placeholder" disabled {% if selected == false %}selected{% endif %}&gt;
        {{ 'collection.sort.title' | t }} by
      &lt;/option&gt;
  
      {% for option in collection.sort_options %}
        &lt;option value="?sort_by={{ option.value }}" {% if value == selected %}selected{% endif %}&gt;
          {{ option.name }}
        &lt;/option&gt;
      {% endfor %}
  
      {% comment %} Clear sorting {% endcomment %}
      &lt;option value="{{ collection.url }}"&gt;Clear&lt;/a&gt;
    &lt;/select&gt;
    {% include 'inline-icon' with svg: 'icon-arrow-down.svg', class: 'current-color-stroke' %}
  &lt;/div&gt;
  </code></pre>