Skip to content

fix(theme/bootstrap): redirect empty search to the home view#3176

Merged
marevol merged 1 commit into
masterfrom
fix/spa-empty-search-redirect-home
Jun 23, 2026
Merged

fix(theme/bootstrap): redirect empty search to the home view#3176
marevol merged 1 commit into
masterfrom
fix/spa-empty-search-redirect-home

Conversation

@marevol

@marevol marevol commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Submitting the SPA search form with a blank query and no conditions (e.g. a sort/num/lang-only URL such as /search?num=10) left the previous query's results rendered on screen. runFromUrl() returned early without re-running a search, and because the results view is re-rendered only by runSearch() while neither showView() nor clearSearchState() clears the results DOM, the stale results stayed visible even though the URL carried no query or filter.

This mirrors the classic server-side behavior, where SearchAction.doSearch() redirects a blank query with no conditions to the top page via redirectToRoot(). runFromUrl() now navigates to / (using history replace, so the empty /search entry is not left in the back/forward stack) instead of leaving the stale results rendered. Searches that carry a keyword, a fields.* filter, a full geo point, or an ex_q are unaffected.

Testing

  • node --check on the modified asset
  • BundledBootstrapThemeTest (120 tests) passes

Submitting the SPA search form with a blank query and no conditions
(e.g. a sort/num/lang-only URL such as /search?num=10) left the
previous query's results rendered on screen. runFromUrl() returned
early without re-running a search, and because the results view is
re-rendered only by runSearch() while neither showView() nor
clearSearchState() clears the results DOM, the stale results stayed
visible even though the URL carried no query or filter.

Mirror the classic server-side behavior, where SearchAction.doSearch()
redirects a blank query with no conditions to the top page via
redirectToRoot(): navigate to "/" from runFromUrl() (using history
replace so the empty /search entry is not left in the back/forward
stack) instead of silently leaving the stale results rendered.
@marevol marevol self-assigned this Jun 23, 2026
@marevol marevol added the task label Jun 23, 2026
@marevol marevol added this to the 15.7.0 milestone Jun 23, 2026
@marevol marevol merged commit 0b1df00 into master Jun 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant