Increase Autocomplete Results Limit #6626
Replies: 7 comments
-
There is a filter for this, check in classes/field/pick.php Apologies for not having more time, am in a place with limited internet |
Beta Was this translation helpful? Give feedback.
-
You also bring up a great point, maybe intentionally :) We should totally show the exact match first if it exists, since by default |
Beta Was this translation helpful? Give feedback.
-
Thanks a lot - will look at that filter. And yes, fixing the sort might make the autocomplete limit moot... |
Beta Was this translation helpful? Give feedback.
-
Re-opening this issue as the AutoComplete filter should be documented and it didn't get added to this issue, either. |
Beta Was this translation helpful? Give feedback.
-
Essentially I'm just looking for documentation.
Also, it would be nice to have the exact match functionality in place as well, so that, for example, if the user enters 'H' the results don't return everything that has an H but instead everything that starts with H Any additional information would help. Thanks. |
Beta Was this translation helpful? Give feedback.
-
You can override the simple options such as string/boolean/integer options or simple array (strings) as documented here: https://select2.org/configuration/options-api JS function callbacks don't work here since this is a PHP filter. Here's a super simple example:
|
Beta Was this translation helpful? Give feedback.
-
Thank you for the response. So am I to understand that there is no way to
modify the autocomplete field to return anything other than 15 results?
thanks,
Steve
…On Tue, Jun 4, 2019 at 8:36 PM Scott Kingsley Clark < ***@***.***> wrote:
You can override the simple options such as string/boolean/integer options
or simple array (strings) as documented here:
https://select2.org/configuration/options-api
JS function callbacks don't work here since this is a PHP filter.
Here's a super simple example:
add_filter( 'pods_pick_select2_overrides', 'my_pods_select2_overrides' );
/**
* Override some of the Select2 options used in the JS init.
*
* @param array|null $select2_overrides Override options for Select2/SelectWoo.
*
* @return array|null Override options for Select2/SelectWoo.
*/
function my_pods_select2_overrides( $select2_overrides ) {
return [
'dropdownCssClass' => 'my-custom-class', // Set a custom dropdown CSS class.
'language' => 'es', // Change the language used.
'debug' => true, // Enable debugging of JS for advanced troubleshooting.
];
}
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3248?email_source=notifications&email_token=ACEE2CMC4YUHHKTX6NIRGH3PY4DAZA5CNFSM4BVMV4YKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODW6IG7A#issuecomment-498893692>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACEE2CPY7XDX2X3K5MGMFZTPY4DAZANCNFSM4BVMV4YA>
.
--
*Stephen Hanson*
Senior Web Developer
51 Islington St., Suite 4 Portsmouth, NH 03801
<https://maps.google.com/?q=51+Islington+St.,+Suite+4+%C2%A0Portsmouth,+NH+03801&entry=gmail&source=g>
*o:* (603) 373-8792 x109 <(603)+373-8792> | *m:* (603) 340-0918 | *f*: (603)
386-6806
*Fishnet Media* <https://www.fishnetmedia.com/optimize>
*Technology-driven marketing to grow your business.*
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a way to increase the number of autocomplete items shown in a Relationship field (to Post Tag)? Right now, when you enter the first few letters, it shows 15 items; and that is not enough for us.
The 15 limit is not enough to show all tags. For example, lets say we have these tags:
aaa xyz
bbb xyz
ccc xyz
ddd xyz
eee xyz
.
.
.
xxx xyz
xyz
When we type xyz, the first 15 show up. But not “xyz”. which is a tag by itself. How do we increase the limit?
On the Pods support forum, Jim True suggested this is handled by the SELECT2 library. Any pointers on how we can modify this behavior?
Beta Was this translation helpful? Give feedback.
All reactions