This repository was archived by the owner on Dec 30, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
packages/react-instantsearch-hooks-web/src/ui Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -207,7 +207,7 @@ export function SearchBox({
207207 className = { cx ( 'ais-SearchBox-reset' , classNames . reset ) }
208208 type = "reset"
209209 title = { translations . resetTitle }
210- hidden = { value . length === 0 && ! isSearchStalled }
210+ hidden = { value . length === 0 || isSearchStalled }
211211 >
212212 < ResetIcon classNames = { classNames } />
213213 </ button >
Original file line number Diff line number Diff line change @@ -349,6 +349,14 @@ describe('SearchBox', () => {
349349 expect ( container . querySelector ( '.ais-SearchBox-reset' ) ) . not . toBeVisible ( ) ;
350350 } ) ;
351351
352+ test ( 'with search stalled hides the reset indicator' , ( ) => {
353+ const props = createProps ( { value : 'query' , isSearchStalled : true } ) ;
354+
355+ const { container } = render ( < SearchBox { ...props } /> ) ;
356+
357+ expect ( container . querySelector ( '.ais-SearchBox-reset' ) ) . not . toBeVisible ( ) ;
358+ } ) ;
359+
352360 test ( 'with search stalled shows the loading indicator' , ( ) => {
353361 const props = createProps ( { isSearchStalled : true } ) ;
354362
You can’t perform that action at this time.
0 commit comments