inveniosoftware / react-searchkit

React component library for interacting with a REST API.
https://inveniosoftware.github.io/react-searchkit/
MIT License
78 stars 40 forks source link

RSK: implement sorting on empty query string #149

Closed ntarocco closed 3 years ago

ntarocco commented 3 years ago
zzacharo commented 3 years ago

I ran the branch locally and noticed that when you enter a query and then change the sorting and clear the query the last sorting is used in the empty query. Is this the desired behavior or everytime an empty query is entered the sorting should change to the defaultOnEmptyString?

I would say that everytime the query string is empty the defaultOnEmptyString should be used :)

ntarocco commented 3 years ago

I ran the branch locally and noticed that when you enter a query and then change the sorting and clear the query the last sorting is used in the empty query. Is this the desired behavior or everytime an empty query is entered the sorting should change to the defaultOnEmptyString?

I would say that everytime the query string is empty the defaultOnEmptyString should be used :)

Good question @KonstantinaStoikou @zzacharo how I have implemented is:

The idea was that if the user selects a sorting, it means (s)he wants that. If I choose sort by most loaned, I am not sure I wanted to be automatically changed back to most recent or bestmatch. WDYT?