React-instantsearch: RatingMenu: Allow rating multi-selection

Created on 21 Nov 2018  路  2Comments  路  Source: algolia/react-instantsearch

The rating menu currently does not support multi-selection.

It would be nice to have this feature, as the workarounds available are not great:

Option 1: Using the RefinementList#transformItems function, you can bastardise the label into displaying the stars by passing a list of elements.

ratings

Though this workaround works (well to an extent), you still get the following warning, as the item label prop type is restricted to strings:

console_warning

Option 2: Another workaround using the RefinementList is to define a custom template. However, the RefinementList component in the react-instantsearch-dom package does not currently support templates - https://github.com/algolia/react-instantsearch/blob/master/packages/react-instantsearch-dom/src/components/RefinementList.js#L12

Most helpful comment

What you can do is make a complete custom refinement list with connectRefinmentList, it wouldn't really make sense to try to shoehorn this behaviour into the regular rating component; since it will act as "x & up", so multiple selections aren't possible.

a connector is a higher order component, giving access to items, and refine which you can use to render the list and as click handler for the input.

Read more:

All 2 comments

What you can do is make a complete custom refinement list with connectRefinmentList, it wouldn't really make sense to try to shoehorn this behaviour into the regular rating component; since it will act as "x & up", so multiple selections aren't possible.

a connector is a higher order component, giving access to items, and refine which you can use to render the list and as click handler for the input.

Read more:

Many thanks for the prompt reply @Haroenv, will look into it 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

danhodkinson picture danhodkinson  路  3Comments

noclat picture noclat  路  3Comments

markmiller21 picture markmiller21  路  3Comments

flouc001 picture flouc001  路  4Comments

itsmichaeldiego picture itsmichaeldiego  路  4Comments