Open carlopascual opened 4 years ago
Hi ReactiveSearch Product Team - I'm supporting this feature request. It is very challenging to add two sort options together or create a custom sort. I have a client requirement to add a sort option based on the updated dates and another couple of fields. But currently, there's no straightforward way to do it. Please provide some alternatives or add a separate component to achieve it.
Hi, Any update on this? @carlopascual
@carlopascual does not work with reactivesearch anymore, neither do I. (we used to be teammates) Thus you shouldn't expect any update from our side.
Affected Projects All
Is your feature request related to a problem? Please describe.
Main problem to solve: I would like to create a custom sorting component for the
ReactiveList
. There have been several issues that have been opened about this already such as: https://github.com/appbaseio/reactivesearch/issues/258 where @metagrover wrote about updating thedefaultQuery
of the result component.I tried this but it seems like the inner
defaultQuery
does not update upon setting a new state.Describe the solution you'd like I think the most intuitive way to do this is to expose the
sort
key onReactiveComponent
'ssetQuery
. Right now, only changes toquery
are made so it isn't as flexible as it can be.Describe alternatives you've considered An alternative solution is to allow the
defaultQuery
to be updated when its function/props change.I might have been doing this wrong so I've provided a codesandbox with both @metagrover 's proposed solution updating the
defaultQuery
ofReactiveList
as well as showing how a potentialsetQuery
with the sort key may look like.https://codesandbox.io/s/tender-ritchie-15b32?file=/src/index.js
Please let me know if there's any other solution that might be better than these. Thanks!