Hi there
I’ve been presented with a business case where our users want to see the most relevant match to their search at the top of the Select2 results.
So for example if I have the following results on screen…
Electric Utilities [Utilities]
Gas Utilities [Utilities]
Utilities
Water Utilities [Utilities]
(Anything in [] is a synonym of the main phrase shown on the left-hand side)
… and my searched phrase is just the word Utilities they want to see the results in this order:
Utilities
Electric Utilities [Utilities]
Gas Utilities [Utilities]
Water Utilities [Utilities]
If I then moved the cursor back to the start of the phrase and start prepending the phrase Gas then the results should reset to the original order until I’ve completed the adding of the word Gas. At that point it should show the order as:
Gas Utilities [Utilities]
Electric Utilities [Utilities]
Utilities
Water Utilities [Utilities]
What they’re essentially asking is a top-suggested result feature. It maybe that the top result is also in bold to help make it stand out.
How would I go about adding this kind of feature to Select2?
Thanks
James