vue-simple-suggest icon indicating copy to clipboard operation
vue-simple-suggest copied to clipboard

add sort function prop

Open shrpne opened this issue 6 years ago • 0 comments

I'm submitting a ...

  • [ ] bug report
  • [x] feature request
  • [ ] support request

What is the current behavior?

For now, there is no "official" way to sort suggestions depending on a search query. I have tried to workaround it by doing sort logic inside list prop function. But using list as non-async function leads to unfixable bug, described in the #301

What is the expected behavior?

I expect to pass a function into sort prop, with parameters like this: sort(a, b, query) {}

What is the motivation / use case for changing the behavior?

I want to sort things :) For example, I have a list: [Facebook, Faceapp, Facetime, Face] And I want to move Face in the first position when user inputs Face. I mean exact match moves to the top of the list. Without such sort and with :max-suggestions=3 user even will not see desired Face in the suggestions at all.

shrpne avatar Apr 03 '20 14:04 shrpne