Skip to content

Commit

Permalink
STSMACOM-872: Reset qindex once the search field is empty. (#1537)
Browse files Browse the repository at this point in the history
(cherry picked from commit 96af01a)
  • Loading branch information
Dmytro-Melnyshyn authored and zburke committed Nov 15, 2024
1 parent 92a9f73 commit 49f5e8e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change history for stripes-smart-components

## [9.2.3] IN PROGRESS

* Reset `qindex` once the search field is empty. Fixes STSMACOM-872.

## [9.2.2](https://github.com/folio-org/stripes-smart-components/tree/v9.2.2) (2024-10-31)
[Full Changelog](https://github.com/folio-org/stripes-smart-components/compare/v9.2.1...v9.2.2)

Expand Down
2 changes: 1 addition & 1 deletion lib/SearchAndSort/SearchAndSort.js
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ class SearchAndSort extends React.Component {
} = this.props;
this.log('action', 'cleared search query');
this.setState({ locallyChangedSearchTerm: '' });
this.transitionToParams({ query: '', ...extraParamsToReset });
this.transitionToParams({ query: '', qindex: '', ...extraParamsToReset });
};

onCloseEdit = (e) => {
Expand Down
14 changes: 14 additions & 0 deletions lib/SearchAndSort/tests/SearchAndSort-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,20 @@ describe('SearchAndSort Query Navigation', () => {
expect(onResetAllSpy.called).to.be.true;
});
});

describe('Selecting another query index', () => {
beforeEach(async () => {
await Bigtest.Select().choose('all');
});

describe('Clearing text field', () => {
beforeEach(async () => {
await TextField().fillIn('');
});

it('removes `qindex` from query', () => HTML({ id: 'query-debug' }).has({ text: 'search:' }));
});
});
});
});

Expand Down

0 comments on commit 49f5e8e

Please sign in to comment.