Change sort by/order on empty query
ntarocco opened this issue · 0 comments
The sort by/order on empty query has been removed because it was not working.
Requirements
The user should be able to set the initial state of the app and also define what is the sort by/order when the query string is empty.
Example:
- when the query string is not empty, the order should be the initial (e.g.
bestmatch
) - when the query string is empty, the order should be the passed one (e.g.
latest
)
If the user changes and select a specific sort by/order, then her/his selection takes precedence and it is user for all queries.
On top of that, the SortOrder component was not taking into account the defaultOnEmptyQuery
options.
As consequence, when searching with a query or with empty query, the SortBy component changes the default value but not the SortOrder.
For example, when searching with query, the search should be probably bestmatch:asc
, while when empty mostrecent:desc
(newest first).