fix(theme/bootstrap): apply sort/num/lang options on search, not on change#3174
Merged
Conversation
…hange The bootstrap (Static/SPA) theme re-ran the search immediately when the sort, num, or lang select in the search-options drawer changed, so results changed before the user pressed the Search button. The default JSP screen only applies these options on submit. Match the JSP behavior: - Remove the change -> runSearch() handlers on the sort/num/lang selects. - Read the current sort/num/lang selects when the header search form is submitted, so a manual change is applied on the Search button. - The search-options Clear button now performs a visual-only reset and no longer re-runs the search (matching the JSP Clear button); the reset is applied on the next search. - The home search form carries the drawer's sort/num/lang selections into the first search. Add regression tests to BundledBootstrapThemeTest.
…ption/geo comments - runFromUrl() now re-renders the search-options drawer selects on every navigation (link / back-forward / facet submit). Without this, the selects kept a stale displayed value and, now that they are applied on the Search button, that stale value was written back to the URL, reverting the user's actual sort/num/lang. - Correct the Clear-button comment: the geo filter is dropped only when the drawer's own Search button reads the now-empty inputs; a header-form submit preserves geo from the URL, matching the JSP theme. - Document why the header submit sets but never deletes num (the num select has no empty placeholder option, so its value is always present). - Add a regression test for the runFromUrl select re-sync.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In the bootstrap (Static/SPA) theme, changing the sort, number of
results, or language select in the search-options drawer immediately
re-ran the search, so results changed before the user pressed the Search
button. The default (JSP) search screen only applies these options when a
Search button is pressed.
Fix (match the JSP behavior)
change -> runSearch()handlers on the sort/num/lang drawerselects, so changing a select no longer auto-runs a search.
selects so a manual change is applied on the Search button.
no longer re-runs the search, matching the JSP Clear button; the reset is
applied on the next search.
the first search.
Tests
BundledBootstrapThemeTest.BundledBootstrapThemeTest: 113 tests pass.node --checkpasses on the edited JS.