I’ve created filter tags for blog posts by inserting this code below in main-blog-liquid:
{% if blog.tags.size > 0 %}
- Filter by:
- {{ 'All Topics' }}
{% for tag in blog.all_tags %}
- {{ tag }}
{% endfor %}
{% endif %}
Underneath this piece of code:
{%- paginate blog.articles by 6 -%}
# {{ blog.title | escape }}
However when a filter tag is selected (e.g “How-to guides”) the page refreshes and the user is scrolled to the top of the page when the filter is applied.
Is there a way to edit this code so when the filter is clicked the user isn’t scrolled to the top of the page or the filter is applied with no whole page refresh and scroll.
Thanks,