AddSearch / search-ui

JavaScript library to develop Search UIs for the web
https://www.addsearch.com/
MIT License
24 stars 4 forks source link

[sc-9515] format sort option's "field" and "order" to array type #108

Closed haoAddsearch closed 8 months ago

shortcut-integration[bot] commented 8 months ago

This pull request has been linked to Shortcut Story #9515: Search UI's SortBy component does not re-render on value changed.

haoAddsearch commented 8 months ago

Looks good to me.

even though I don't understand the single value to array conversion reasoning, the conversion seems to be correct.

In the past, sortBy method and sortBy order is string-type. For example: "relevance", "date", "custom_fields.tag" Then in release 0.7.7 we supported array-type: ["relevance", "date"] (both string and array are supported) and it caused some conflict. So I now format string value to arrays in all cases after Search UI component receives these values.

https://github.com/AddSearch/search-ui/releases/tag/v0.7.7