Forums › Forums › Search & Filter Pro › Issue with combobox and exact match
Tagged: select2
- This topic has 3 replies, 2 voices, and was last updated 4 years ago by Trevor.
-
Anonymous(Private) October 27, 2020 at 5:45 pm #264306
Hi,
We are using combobox with a taxonomy search. The data being searched are mantra names. In many cases, a mantra name will exist in another mantra name. For example, “sa ta na ma” and “Ra Ra Ra Ra Ma Ma Ma Ma Rama Rama Rama Ram Sa Ta Na Ma”.
In this case, when the user enters “sa ta na ma” in the combobox, it returns both mantras with the “Ra Ra Ra Ra Ma Ma Ma Ma Rama Rama Rama Ram Sa Ta Na Ma” being displayed first (alphabetically). And, if the user hits the enter key upon typing in “sa ta na ma”, instead of going to the mantra record “Sa Ta Na Ma” it goes to the other record. Please see this video recording illustrating the issue: https://www.loom.com/share/ba63e71503ec42c49227870ffb761700.
We tried using a dropdown in this context; however, because the number of records is so high, it’s not very UX-friendly. Just using a general search is also less than ideal because the keywords are unusual and users frequently need to see them.
Is there anyway to have the combobox search recognize exact matches?
Trevor(Private) October 28, 2020 at 7:03 am #264354It is theoretically possible, but you would need a coder’s help. If, in our plugin’s Settings page (not the form itself) you have not already done so, change the Combobox script from Chosen to Select2. The Chosen script is included with/used by our plugin by default. However, it is now pretty much abandoned and has not received any major updates in a long time. It has poor support for iOS devices for example.
In the current version of our plugin, there is an option in our settings page to choose which (Combobox) script to use.
Go to
wp-admin
->Search & Filter
->Settings
->Combobox Script
Change this from
Chosen
toSelect2
The Select2 script is then available for you to apply to the form. Select2 is maintained now by the WooCommerce team, who are, of course, owned by Automattic, the owners of WordPress, and as such is used by a lot of themes and plugins. In the next version of our plugin, we are likely to switch to Select2 as the default.
This discussion might then be helpful, I am not sure:
-
AuthorPosts