Skip to content

Commit

Permalink
Merge pull request #117 from AddSearch/sc-9880/js-client-setpaging-is…
Browse files Browse the repository at this point in the history
…-overriden-by-search-ui

fix: [sc-9880] Search UI overrides default page (from client.setPaging)
  • Loading branch information
haoAddsearch authored May 8, 2024
2 parents ae3d6dd + 6016995 commit e37b16c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/addsearch-search-ui.min.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/addsearch-search-ui.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "addsearch-search-ui",
"version": "0.8.6",
"version": "0.8.7",
"description": "JavaScript library to develop Search UIs for the web",
"main": "./dist/addsearch-search-ui.min.js",
"jsdelivr": "./dist/addsearch-search-ui.min.js",
Expand Down
2 changes: 1 addition & 1 deletion src/actions/sortby.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export function sortBy(client, field, order, store) {
setHistory(HISTORY_PARAMETERS.SORTBY, JSON.stringify({field: field, order: order}), null, store);
}
const paging = client.getSettings().paging;
client.setPaging(1, paging.pageSize, field, order);
client.setPaging(paging.page, paging.pageSize, field, order);

return {
type: SORTBY,
Expand Down
3 changes: 2 additions & 1 deletion src/util/history.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ function handleURLParams(client, store, qs, createFilterObjectFunction, searchFu
store.dispatch(setPage(client, parseInt(qs[HISTORY_PARAMETERS.PAGE], 10), null, store));
}
else {
store.dispatch(setPage(client, 1, null, store));
const paging = client.getSettings().paging;
store.dispatch(setPage(client, paging.page, null, store));
}

if (qs[HISTORY_PARAMETERS.SEARCH]) {
Expand Down

0 comments on commit e37b16c

Please sign in to comment.