SOLVED: {search_term_filter}` not refreshing after Submit (AJAX)

Hi Team,

I’ve found an issue with the {search_term_filter} dynamic tag.

Steps to reproduce:

  1. Create a Search Filter field with a Submit button.
  2. Add a text element outside the query loop with a dynamic tag:
Search results for: {search_term_filter:example}
  1. Perform a search and submit via AJAX (without page reload).

Expected behavior:
The {search_term_filter} value should refresh with the new search term after the Submit action.

Actual behavior:

  • On AJAX submit (clicking the button) → results update, but {search_term_filter} does not refresh.
  • On full page reload{search_term_filter} refreshes correctly.
  • Inside a query loop No results → section{search_term_filter} works correctly.
  • On pressing Enter in the search field → it refreshes as expected.
  • On input search (live input) → it also refreshes correctly.

Summary:
{search_term_filter} only fails to refresh when submitting via the filter submit button.

Thanks for checking this out!

Quick Fix for {search_term_filter} Not Refreshing After Click Submit

If anyone is facing the issue where {search_term_filter} does not update when clicking the filter submit button, here’s a simple temporary solution until the team provides an official fix:

document.addEventListener('bricks/ajax/query_result/displayed', () => {
    const inputValue = document.querySelector(".job-serach-filter input")?.value;// Change to your input field selector
    if (!inputValue) return;

    const termElements = document.querySelectorAll(".search-results [data-brx-ls-term]");// Change to your search result text field selector
    if (termElements.length === 0) return; 

    termElements.forEach(el => el.textContent = inputValue);
});

Hi @Binu,

thank you for your report. I was able to replicate it and I created a local task for it. It appears that the issue only happens if we choose “on submit.” If we choose “on input”, then it works.

Once we fix this, we will update this topic.

Thank you,
Matej

1 Like

Hi Matej,

Thanks a lot for confirming and creating a task for it :first_quarter_moon_with_face: I’m glad to hear you were able to replicate the issue.
Looking forward to the update — really appreciate the quick response!

Thank you,
Binu

1 Like

We fixed this issue in Bricks 2.2 beta, which is now available in your account.
Changelog: Bricks 2.2-beta Changelog – Bricks

Please let us know if you are still experiencing issues.

As with any pre-stable release, please do not use it on a production/live website. It is only meant for testing in a local or staging environment. The more feedback we get, the better :v:

1 Like