-
Notifications
You must be signed in to change notification settings - Fork 386
fix(connectToggle): use currentRefinement in metadata instead of the label #909
fix(connectToggle): use currentRefinement in metadata instead of the label #909
Conversation
Deploy preview for react-instantsearch ready! Built with commit 38f4f44 |
@@ -109,14 +109,16 @@ export default createConnector({ | |||
const checked = getCurrentRefinement(props, searchState, this.context); | |||
const items = []; | |||
const index = getIndex(this.context); | |||
|
|||
if (checked) { | |||
items.push({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
really weird conditional pushing IMO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which behaviour you will expect instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const items = checked ? [{..stuff}] : []
I'm not sure if it's that much better though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep not sure, because the ternary will be split on several line.
if (checked) { | ||
items.push({ | ||
label: props.label, | ||
currentRefinement: props.label, | ||
currentRefinement: checked, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense wrt that issue
<a name="4.5.0"></a> # [4.5.0](v4.4.2...v4.5.0) (2018-02-06) ### Bug Fixes * **connectRange:** use the same behaviour for currentRefinement in getMetadata ([#923](#923)) ([08917b6](08917b6)) * **connectToggle:** use currentRefinement in metadata instead of the label ([#909](#909)) ([89cae2b](89cae2b)) * **StarRatings:** always show the stars below ([#929](#929)) ([22bf93a](22bf93a)) ### Features * **connectStateResults:** expose isSearchStalled ([#933](#933)) ([f45ba27](f45ba27))
Summary
Close partially #891