You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a list of items, where only one can be choses, is really long, it gets complicated to show all options. For that reason we added search for facet values on refinement lists. This behaviour also applies to Menu. An example of a long list with only one choice is countries
Detailed design
add searchForItems (fn) to the connector
implement it the same as for refinementList (link)
add searchable option to widget
add the searchbox etc. to the widget as necessary
implement in Vue InstantSearch and Angular InstantSearch
Drawbacks
Why should we not do this? Please consider:
code size increase
should not be too big, because it's code which is very close to the refinement list code
timing
we can wait until Vue InstantSearch has moved to connectors in beta so we don't need to wait for this to be implemented
Alternatives
Using a refinement list and allowing selection of multiple values, or hacking around in that function to make sure only one refinement is possible. This doesn't seem like that good of an alternative to be honest.
How we teach this
Update the documentation, maybe a guide for searchable lists in general like React InstantSearch
This discussion was converted from issue #2893 on December 19, 2022 13:33.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Summary
Just like
refinementList
, there are some cases in which you'd want to search within the options, even if there's only one option that can be chosenBasic example
Motivation
When a list of items, where only one can be choses, is really long, it gets complicated to show all options. For that reason we added search for facet values on refinement lists. This behaviour also applies to Menu. An example of a long list with only one choice is
countries
Detailed design
searchForItems
(fn) to the connectorsearchable
option to widgetDrawbacks
Why should we not do this? Please consider:
Alternatives
Using a refinement list and allowing selection of multiple values, or hacking around in that function to make sure only one refinement is possible. This doesn't seem like that good of an alternative to be honest.
How we teach this
Update the documentation, maybe a guide for searchable lists in general like React InstantSearch
Beta Was this translation helpful? Give feedback.
All reactions