Skip to content

Commit

Permalink
fix(refinementList): canRefine is calculated for searchable (#6494)
Browse files Browse the repository at this point in the history
Before this PR `canRefine` was always true for searchable.

[FX-3190]

BREAKING CHANGE: `canRefine` is false if there are no results from searchable if there's a query.
  • Loading branch information
Haroenv authored Dec 30, 2024
1 parent 3b0e539 commit 301fc10
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1122,7 +1122,7 @@ See documentation: https://www.algolia.com/doc/api-reference/widgets/refinement-
refine: expect.any(Function),
searchForItems: expect.any(Function),
isFromSearch: true,
canRefine: true,
canRefine: false,
widgetParams: {
attribute: 'category',
limit: 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,6 @@ export type RefinementListRenderState = {
isFromSearch: boolean;
/**
* `true` if a refinement can be applied.
* @MAJOR: reconsider how `canRefine` is computed so it both accounts for the
* items returned in the main search and in SFFV.
*/
canRefine: boolean;
/**
Expand Down Expand Up @@ -324,7 +322,7 @@ export const connectRefinementList: RefinementListConnector =
}),
items: normalizedFacetValues,
canToggleShowMore: false,
canRefine: true,
canRefine: normalizedFacetValues.length > 0,
isFromSearch: true,
instantSearchInstance,
},
Expand Down

0 comments on commit 301fc10

Please sign in to comment.