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
Is your feature request related to a problem? Please describe.
I often find myself in a situation where I need to sort the options based on the user's search query. Currently, I resort to implementing a fake-asynchronous search to achieve the desired sorting of results, but it would be more efficient and cleaner to have a native feature for sorting based on the search query.
Describe the solution you'd like
I would like to propose the addition of a new property, sortBy, that can be utilized alongside filterBy. This property should allow users to specify a custom sorting function that will be applied to the filtered options based on the user's search query. For example:
<Typeahead// existing props...filterBy={(option,props)=>{/* existing filter logic */}}sortBy={(options,props)=>{// Custom sorting logic based on the search query// ...returnsortedOptions;}}/>
How is this solution useful to others?
This feature would be beneficial for scenarios where users expect a customized sorting order based on their search input. It provides a more flexible and generalized way to handle result sorting, addressing a common use case across various applications.
Describe alternatives you've considered
As mentioned earlier, the current workaround involves implementing a simulated asynchronous search to manually sort the results in the onSearch handler. However, having a built-in option for dynamic sorting based on the search query would streamline the process and make the code more maintainable.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I often find myself in a situation where I need to sort the options based on the user's search query. Currently, I resort to implementing a fake-asynchronous search to achieve the desired sorting of results, but it would be more efficient and cleaner to have a native feature for sorting based on the search query.
Describe the solution you'd like
I would like to propose the addition of a new property,
sortBy
, that can be utilized alongsidefilterBy
. This property should allow users to specify a custom sorting function that will be applied to the filtered options based on the user's search query. For example:How is this solution useful to others?
This feature would be beneficial for scenarios where users expect a customized sorting order based on their search input. It provides a more flexible and generalized way to handle result sorting, addressing a common use case across various applications.
Describe alternatives you've considered
As mentioned earlier, the current workaround involves implementing a simulated asynchronous search to manually sort the results in the
onSearch
handler. However, having a built-in option for dynamic sorting based on the search query would streamline the process and make the code more maintainable.The text was updated successfully, but these errors were encountered: